add SELF transaction type #34

Merged
merged 2 commits into from Mar 7, 2013

Projects

None yet

2 participants

@mreiferson

it allows you to deterministically identify a running node... this has been helpful for our use of doozerd at bitly particularly in scripts for cluster setup and daemon instantiation

ready for review @kr

matching pull request for client code on https://github.com/ha/doozer coming up

@bketelsen
ha member

Closing this issue - newer code exists and should be merged against updated codebase with new PR.

@bketelsen bketelsen closed this Mar 1, 2013
@bketelsen bketelsen reopened this Mar 1, 2013
@bketelsen
ha member

We need community consensus on this feature addition. Can other people chime in with +1, thumbs up, please?

+1 from me

@mreiferson

I should probably add tests for this too :)

@mreiferson

Perhaps a more detailed description would be helpful for discussion.

When initializing a doozer cluster you need to add nodes under /ctl/cal/<id> for each participating instance. We wanted a way to be able to do this deterministically such that as instances come and go (hosts die, topology changes, etc.) we would know whether or not a given instance was already correctly configured in the cluster.

We did two things in order to accomplish this:

  1. the /ctl/cal/<id> was based on our hostname the instance ran on, ie: app01.hostname.org == /ctl/cal/1 and app03.hostname.org == /ctl/cal/3

  2. we added the SELF command so that we could query a doozer instance to retrieve its internal ID (the value that is assigned to the /ctl/cal/<id> node).

This allowed our cluster initialization script to query doozer and see what the value of that node was (if it existed). If it did not exist or did not match the value returned by a SELF command it meant that the node was not correctly configured and needed to be bootstrapped.

This also made the script idempotent.

I was planning on opening a pull request with some of these scripts relating to #46.

I would love to hear how others have resolved these issues for their production setups so we can decide whether or not this makes sense to go in.

@bketelsen
ha member

It would be nice to see the startup scripts too. This has been a real pain point for us on doozerd startup.

@mreiferson

pushed a commit w/ said script

@bketelsen
ha member

this is very nice.

@mreiferson mreiferson referenced this pull request in ha/doozer Mar 7, 2013
Merged

add SELF txn #13

@bketelsen bketelsen merged commit f248dc5 into ha:master Mar 7, 2013

1 check passed

Details default The Travis build passed
@mreiferson

I wasn't quite ready for that script to go in, but I'll continue work on it in #46.

There are a couple gotchas that I will document there and solicit feedback.

🔨 time

This was referenced Mar 11, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment