Skip to content

Missing method to expose Campaign.keyRevision to SDK consumers #199

@qhung312

Description

@qhung312

Hi, I was playing around with this SDK to help perform leader election & coordination for my own project. After a leader has been elected (through Election.campaign), I believe keyRevision of Campaign should be available for the client.

According to the concurrency API reference, when leaders write data to etcd, they should use the leader revision number to check if their leadership still holds, to help avoid split-brain situations.

rev is the creation revision of the key. It can be used to test for ownership of an election during transactions by testing the key’s creation revision matches rev

The Go client exposes the revision number in the Election struct. Currently, Campaign supports getCampaignKey, but there is no way to get the revision (other than something like (campaign as any).keyRevision).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions