couchbaselabs / cbgt

*THIS PROJECT HAS MOVED* from couchbaselabs TO: https://github.com/couchbase/cbgt -- no further development will be done here on couchbaselabs/cbgt
Apache License 2.0
2 stars 1 forks source link

Autofailover subpackage #28

Closed tleyden closed 9 years ago

tleyden commented 9 years ago

Add a new subpackage cbgt/autofailover which would allow an API similar to the following:

func main() {

  ...

  cfg := ... start a Cfg...

  mgr := cbgt.NewManager(..., cfg, bucketName)

  mgr.Start(...)

  hbOptions := { ...

    HeartBeatTime: ... e.g., every 5 seconds

    StaleHeartBeatTimeout: ... haven't heard a heartBeat update /* 30 secs */

    ...

  }

  ...

  autoFailover := hb.StartAutoFailover(couchbaseURL/auth,

     bucketName, "someKeyPrefix", mgr, hbOptions)

     ==> calls cbheartbeat

  ...

  autoFailover.Stop()

}

where he "heartbeat grunt work" would be factored out (or easily refactorable) into a separate lib.

steveyen commented 9 years ago

Hi @tleyden

Just to get on same page, I see it as two subpackages (you might already be thinking the same thing)...

tleyden commented 9 years ago

Yep, agreed. Factored out a new ticket.

tleyden commented 9 years ago

Preliminary test results -- it doesn't seem to be moving around the pindexes after calling CfgRemoveNode. Here are the logs: https://gist.github.com/tleyden/f9d9c86077ba63ba3cb5