Skip to content

Commit

Permalink
Merge remote-tracking branch 'couchbase/unstable' into HEAD
Browse files Browse the repository at this point in the history
http: //ci2i-unstable.northscale.in/gsi-04.08.2022-14.25.pass.html
Change-Id: I59b428ac2c206f59a41552580d44395d5642470c
  • Loading branch information
amithk committed Aug 4, 2022
2 parents 1ee0da4 + 6400782 commit 7926c00
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions secondary/indexer/storage_manager.go
Expand Up @@ -984,9 +984,9 @@ func (sm *storageMgr) rollbackToSnapshot(idxInstId common.IndexInstId,
logging.Infof("StorageMgr::handleRollback Rollback Index: %v "+
"PartitionId: %v SliceId: %v To Snapshot %v ", idxInstId, partnId,
slice.Id(), snapInfo)
restartTs = snapInfo.Timestamp()
restartTs = snapInfo.Timestamp().Copy()
if markAsUsed {
slice.SetLastRollbackTs(restartTs)
slice.SetLastRollbackTs(restartTs.Copy())
}
} else {
//send error response back
Expand Down
10 changes: 10 additions & 0 deletions secondary/indexer/stream_state.go
Expand Up @@ -1459,6 +1459,11 @@ func (ss *StreamState) getNextStabilityTS(streamId common.StreamId,
//generate new stability timestamp
tsVbuuid := ss.streamKeyspaceIdHWTMap[streamId][keyspaceId].Copy()

//Explicitly set the snapAligned flag to false as the initial state.
//HWT can be set from an earlier restartTs which is snap aligned
//and the flag needs to be reset for new timestamp.
tsVbuuid.SetSnapAligned(false)

tsElem := &TsListElem{
ts: tsVbuuid,
}
Expand All @@ -1479,6 +1484,8 @@ func (ss *StreamState) getNextStabilityTS(streamId common.StreamId,

if tsElem.ts.CheckSnapAligned() {
tsElem.ts.SetSnapAligned(true)
} else {
tsElem.ts.SetSnapAligned(false)
}

return tsElem
Expand Down Expand Up @@ -1699,7 +1706,10 @@ func (ss *StreamState) computeTsChangeVec(streamId common.StreamId,
if enableOSO {
if ts.CheckSnapAligned() {
ts.SetSnapAligned(true)
} else {
ts.SetSnapAligned(false)
}

}

return changeVec, noChange, countVec
Expand Down
2 changes: 2 additions & 0 deletions secondary/indexer/timekeeper.go
Expand Up @@ -3310,6 +3310,8 @@ func (tk *timekeeper) mayBeMakeSnapAligned(streamId common.StreamId,

if flushTs.CheckSnapAligned() {
flushTs.SetSnapAligned(true)
} else {
flushTs.SetSnapAligned(false)
}

}
Expand Down

0 comments on commit 7926c00

Please sign in to comment.