Description
When cbgt is running a rollback, it will use failover logs to determine the next valid point in the the failover logs to rollback to using:
var rollbackVbuuid uint64
|
vbMetaData, _, err := f.getMetaData(vbId)
|
if err == nil && len(vbMetaData.FailOverLog) > 0 {
|
for j := 0; j < len(vbMetaData.FailOverLog); j++ {
|
if vbMetaData.FailOverLog[j][1] <= rollbackSeqno {
|
rollbackVbuuid = vbMetaData.FailOverLog[j][0]
|
break
|
}
|
}
|
}
|
If vbMetaData.FailOverLog contains
{bad vbuuid, 0}, as it might if the failover log came from a different bucket, this will cause a rollback loop since each time since OpenStream would call startSeq=0, vbUUID=bad vbuuid. In this case the server will issue a rollback due to memd.DcpStreamAddFlagStrictVBUUID.
A fix would be to not set rollbackVbuuid when the rollbackSeqNo is 0.
if vbMetaData.FailOverLog[j][1] <= rollbackSeqno && vbMetaData.FailOverLog[j][i] != 0 {
|