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-03.02.2022-09.30.pass.html
Change-Id: I44e250b76fe2145377a118bc7e5d0f1e3ff05d52
  • Loading branch information
amithk committed Feb 3, 2022
2 parents 058c2d9 + fca563b commit dcd88f5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
4 changes: 2 additions & 2 deletions secondary/common/timestamp.go
Expand Up @@ -466,9 +466,9 @@ func (ts *TsVbuuid) Clone() *TsVbuuid {
func (ts *TsVbuuid) String() string {
var buf bytes.Buffer
vbnos := ts.GetVbnos()
fmsg := "bucket: %v, scopeId: %v, collectionId: %v, vbuckets: %v Crc64: %v snapType %v -\n"
fmsg := "bucket: %v, scopeId: %v, collectionId: %v, vbuckets: %v Crc64: %v snapType %v OpenOSOSnap %v -\n"
buf.WriteString(fmt.Sprintf(fmsg, ts.Bucket, ts.ScopeId, ts.CollectionId,
len(vbnos), ts.Crc64, ts.SnapType))
len(vbnos), ts.Crc64, ts.SnapType, ts.OpenOSOSnap))

if ts.OSOCount == nil {
fmsg = " {vbno, vbuuid, manifest, seqno, snapshot-start, snapshot-end}\n"
Expand Down
19 changes: 14 additions & 5 deletions secondary/indexer/timekeeper.go
Expand Up @@ -2272,14 +2272,23 @@ func (tk *timekeeper) checkInitialBuildDone(streamId common.StreamId,

if buildInfo.buildTs == nil {
initBuildDone = false
} else if buildInfo.buildTs.IsZeroTs() { //if buildTs is zero, initial build is done
} else if buildInfo.buildTs.IsZeroTs() && flushTs.IsSnapAligned() && (!enableOSO || !flushTs.HasOpenOSOSnap()) {
// if buildTs is zero, initial build is considered as done under following cases
// flushTs is nil (isSnapAligned and hasOpenOSOSnap would handled nil flushTs correctly)
// flushTs is non-nil but is snapAligned in non-OSO mode
// flushTs is non-nil, is snapAligned and does not have OpenOSOSnapShot for OSO mode
//
// Also note that we can not remove the check for buildTs.isZeroTs as there are cases where flushTs can be nil,
// and given that, a non-zero buildTs with nil flushTs is considered as initialBuildDone = false (as covered by next condition).
// even if last else condition ts.GreaterThanEqual would take care of zero buildTs we will not reach there if flushTs is nil and we do not have
// special handling of buildInfo.buildTs.IsZeroTs() conditon here.
initBuildDone = true
} else if flushTs == nil {
} else if flushTs == nil { // in case of non-zero buildTs we can not have nil flushTs to complete the initialBuild.
initBuildDone = false
} else if enableOSO && (flushTs.HasOpenOSOSnap() || !flushTs.IsSnapAligned()) {
//build is not complete till all OSO Snap Ends have been received
} else if !flushTs.IsSnapAligned() { // non-Zero buildTs, non-nil flushTs, flushTs must be snap aligned.
initBuildDone = false
} else if !enableOSO && !flushTs.IsSnapAligned() {
} else if enableOSO && flushTs.HasOpenOSOSnap() {
//build is not complete till all OSO Snap Ends have been received
initBuildDone = false
} else {
//check if the flushTS is greater than buildTS
Expand Down

0 comments on commit dcd88f5

Please sign in to comment.