January 13th, 2002

Cluster Update

Update from CVS and you'll notice a new tool in bin: moveucluster.pl. This is the script to move users between clusters. Currently only moving from cluster 0 (the old non-cluster schema) is supported.

To play with this, though, you'll need the rest of the code. Apply this patch:


Realize some people may not know patch:

$ cd ~lj
$ patch -p3 < cluster.20010112.diff
(if your lj root is /home/lj, -p0 will also work, in which case your current directory won't matter)

Then, in your ljconfig.pl, you need to define a slave (not the master, even if it has the same DSN) with a role of "cluster1" and "cluster1slave", as well as define @CLUSTERS with valid clusterids for your site.

So basically you're running cluster 0 and cluster 1 on the same machine. (which is exactly what LJ will do...) And we'll have another cluster 2 rooted off cartman (robust hardware, lots of disk). Then it's time to start buying more database servers.

Anyway, to run this afterwards:

$ moveucluster.pl test 1
Easy, eh? No way to move a user back to cluster 0, though (that'd be dumb), so keep a snapshot of your database around to reset to.

Collapse )


IM Functions

So I was working on an instant-messaging listing page (suggested here). I have a vague prototypy thing at http://goathack.livejournal.org:8052/imlist.bml; the source is http://goathack.livejournal.org:8052/imlist.bml.txt. This is my first real LJ patch, so feel free to yell at me if there's anything dumb in it.

Anyway, a real version of this would have a header of "AOL IM" instead of "aolim", and the full set of links like in userinfo.bml instead of just the (unquoted, too) account name. But I'm not going to just copy the code.

I figure we need a few functions to organize this. We'd want LJ::im_service_list, which returns a list of 'aolim', 'jabber', etc. Then there's LJ::im_service_name($service), which maps 'aolim' onto 'AOL IM' (also to be used as the label in userinfo.bml). And then there would be LJ::im_service_link($service, $id), which returns some HTML that marks up the user ID for putting into userinfo.bml, imlist.bml, etc. I'd also update all other code that deals with IM services.

So, questions. First of all, names: are these good names for the functions? Am I missing others? Is imlist.bml a good name? Where do I put these functions: in ljlib.pl? I'd probably make it mostly data-driven, so where do I put the table? Right next to the function or at the top of the file or somewhere else?

Also, is there an lj_dev IRC or other chat place? I keep having minor questions (cvsreport -d doesn't seem to work with newly created files, say) that I don't really want to have to post here.

OK, patch number two: a patch to ljlib.pl and also a new imlist.bml (I can't figure out how to get cvsreport.pl to deal with new files. If we're going down this road, though, we'd want to convert most code that deals with IM services to using this.

Seattle LJ Hackfest

What: 1st Ever Weekly LJ Hackfest
Where: Espresso Roma, 4201 University Way, Seattle WA, 98105?
When: Monday Night, 7:00 - 9:00 pm
Bonus: At 9:00 pm, come to Dante's and drink with us! (Monday night tradition)

I'd like to start having weekly LJ Hackfests in the Seattle area. People can bring their wireless cards & laptops and we can meet at 802.11-enabled coffee shops (just to use their base stations, even if we don't pay for access)

I'm thinking the following people could probably attend:
bradfitz -- i'll be there
bostonsteamer -- confirmed
sherm -- 95% chance of being there
evan -- ?
supersat -- ?

If you don't have a wireless card (Evan?) I'll bring a cross-over cable along and I'll just plug in both of my network cards.

Purposes of hackfests:
  • be social
  • drink lots of chai
  • more exciting that working alone
  • discuss proper ways to do things
  • test each other's works in progress
  • review queued patches and collectively review their fitness for inclusion
  • etc, etc, etc...
alister, lift
  • alister

Show the people that list you as a friend, you also list (update)


I'd like to present this edit_do.bml diff to the group....

It alters your friends page to show which, amongst those people that list you a friend, you also list as a friend.

An example

John Doe and Fred both list Alister as a friend.
Alister has John Doe listed.
User           Name          is friend?
John Doe       John Q. Doe   yes
Fred           Fred Bloggs   no

You know that you could add Fred as a mutual friend, and there's no need to compare the is friend/your friend list..

Potential extentions:
Graphics - ticks and crosses for yes/no
Hyperlink to add username to list of friends (or javascript to insert name in 'Add Friends' at bottom of that page)

Downside: I have not got a live-running local test system, just the CVS - so this is untested. The change isn't rocket-science though, just re-ordered the database search (to collect the who-are-your-friends info) and put another column out, based on that.

Update: The diff above has been verified as working OK, and completes the basic functionality. I can get a test server together to add further to it, or leave as it is (working fine) for now. Your comments appreciated.
  • Current Mood

Updated Goals

Every month I try to update the goals graph:

Yellow = work in progress (including dependencies)
Green = done
Gray = normal
White = somewhat low priority

Probably missing some stuff, but that's the general idea.

This evening I worked on the get_dbh overhaul, which is actually a dependency for the "dual schema aware code", though I forgot the edge. Basically, right now we cache from DB Role to DB Handle. We need to have two caches: From Role to DSN and from DSN to Handle. Right now it's possible for a process to open up multiple connections to the same database just because that database fulfills multiple roles. In reality, that's never been an issue because of how we have things setup, but with the clsuter config, get_dbh()'s shortcomings would show up, so I'm going to finish fixing that tomorrow evening.