IndexBuildsManager::commitIndexBuild() currently gets called in 4 places.
1) startup recovery - which does non-timestamped writes.
2) Index build via coordinator (both primary and secondary) - since onCreateEachFn & onCommitFn now sets the ghost timestamp for catlog writes on secondaries (w/ FCV set to 4.2 & 4.4), then what's the purpose of calling IndexTimestampHelper::setGhostCommitTimestampForCatalogWrite here. Also, that line doesn't do anything because requiresGhostCommitTimestampForWrite() will return false as writesAreReplicated() returns false at that point.
3) SystemIndexBuild - Always runs on primary. so, need of ghost timestamp.
4) Foreground index build on secondaries - Since it's inline. This also doesn't requires ghosty timestamp.
So, this piece of code acts as dummy. And, it's good to remove it so that it's easy for future readers.
- related to
-
SERVER-45028 move timestamping logic for completing single-phased index builds within IndexBuildsCoordinator
- Closed