title: Understanding etcd Leader election APIs
body: <p>I am trying to understand various functions provided by etcd election api and what they mean semantically.</p>
  <p>In their official documentation very briefly mentioned about what each function does, and no examples are provided.
  For example we have methods:</p>
  <pre><code>func (e *Election) Campaign(ctx context.Context, val string) error
  </code></pre>
  <p>As per my understanding campaign is used to enroll node for leadership in an election, and it is blocked until that is achieved or some error occurs.</p>
  <pre><code>func ResumeElection(s *Session, pfx string, leaderKey string, leaderRev int64) *Election
  </code></pre>
  <p>This one I am not sure of why we need to resume election, suppose node is already a leader.
  Maybe my lack of understanding is due to semantics used here.</p>
  <p>Since we have to use a common election identifier why don't just single election suffice?</p>
  <p>Finally my use case is to run several nodes and only allow leader to make carry out some computation/updates, under what circumstances I'd have to create new elections if single election won't be enough.</p>