Currently the fast count gets flushed to WT/disk only during following cases.
1) fsync
2) clean shutdown.
3) During releasing WT session at an interval of 60 seconds (default) or 1000 ticks.
4) During recovering to stable timestamp
Basically, fast count is not tolerant to unclean shutdowns. So, if a node containing non-empty collections restarts after an unclean shutdown, there is a possibility that that fast count returned after node restart can be 0 for that non-empty collection. As, a result, index build can skip index building thinking that's an empty collection.
- related to
-
SERVER-24266 Large discrepancy in SizeStorer after unclean shutdown
- Open
-
SERVER-45201 Implicit collection creation from createIndexes can stall replication on secondaries by circumventing thread pool on primary
- Closed
-
SERVER-48253 invariant in IndexCatalogImpl::createIndexOnEmptyCollection() fails due to inaccurate fast count
- Closed
-
SERVER-57578 Use isEmpty instead of numRecords to check if there are any documents left in a collection
- Closed