MB-20822: Erase all diverged branch entries correctly in failover table 81/67481/6
authorManu Dhundi <manu@couchbase.com>
Wed, 14 Sep 2016 19:12:29 +0000 (12:12 -0700)
committerManu Dhundi <manu@couchbase.com>
Fri, 30 Sep 2016 00:44:22 +0000 (00:44 +0000)
commit4eae12aa7d372d02e14c81c5eb733e5912f81f69
treec8d5b4520256be5e7283b0306cc6e568334ac938
parent1e0eea228eb249297bf1793f7ee5dc8fc8ce499c
MB-20822: Erase all diverged branch entries correctly in failover table

When we add an entry in failover table we must erase all the other
entries with higher seqno because they are from a diverged branch.

This commit fixes a bug in the loop that was erasing diverged entires.
In a std::list when we erase an entry, the function returns the
iterator pointing to next element and hence we must be careful not to
double increment it.

Change-Id: I9275fba8057f26e2853a8d7d359f1d01f107f2be
Reviewed-on: http://review.couchbase.org/67481
Reviewed-by: Dave Rigby <daver@couchbase.com>
Well-Formed: buildbot <build@couchbase.com>
Tested-by: buildbot <build@couchbase.com>
src/failover-table.cc
src/failover-table.h
tests/module_tests/failover_table_test.cc