-
Type: Bug
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Catalog and Routing
-
ALL
-
v8.0
-
Execution Team 2024-06-24, Execution Team 2024-07-08, CAR Team 2024-09-30, CAR Team 2024-10-14, CAR Team 2024-10-28, CAR Team 2024-11-11, CAR Team 2024-11-25
-
200
'expireAfterSeconds' can be persisted as type int, long, or decimal in the durable catalog. This can cause index metadata inconsistencies across multiversion clusters (SERVER-92364), among other issues.
The existing approach to normalize 'expireAfterSeconds' to integer types is ineffective / incomplete for several reasons.
The InvalidTTLIndexFixer runs onStepUp(), and tries to normalize any non-int 'expireAfterSeconds' to their integral value via collMod.
However
- collMod updates 'expireAfterSeconds' to be of type long when it updates the durable catalog (BSONCollectionCatalogEntry::IndexMetadata::updateTTLSetting(long long newExpireSeconds))
- The onStepUp() approach is per-replica set, and does not account for sharded environments or FCV.
-
- Pre 7.3, createIndexes stored 'expireAfterSeconds' as the provided numeric type (double, long, int).
- Starting 7.3, createIndexes silently truncates 'expireAfterSeconds' to an integral value.
- There is a bug that collMod is a no-op when the old and new expireAfterSeconds are equivalent when both are casted to type safeNumberLong() (
SERVER-92366).
Whatever approach we choose, it should tackle 'expireAfterSeconds' type consistency across shards, replicas, and different server versions.
Old Description
InvalidTTLIndexFixer can find 'expireAfterSeconds' of type kNonInt when running on data generated from the newest version of mongod.
SERVER-77828 aimed to normalize expireAfterSeconds into an int on creation/collMod. The InvalidTTLIndexFixer runs on stepUp() to normalize any legacy data from older versions during upgrade.
We should investigate why it still finds kNonInt 'expireAfterSeconds' on non-legacy data.
- is depended on by
-
SERVER-92364 checkMetadataConsistency() fails on mixed version shards with 'expireAfterSeconds' as double
- Blocked
-
SERVER-92360 Oplog entries report collMod 'expireAfterSeconds' field as type 'long'
- Blocked
-
SERVER-92253 Update $listCatalog 'expireAfterSeconds' behavior in catalog/README.md
- Blocked
- is related to
-
SERVER-92364 checkMetadataConsistency() fails on mixed version shards with 'expireAfterSeconds' as double
- Blocked
-
SERVER-91501 TTLMonitor can crash trying to deregister an already deregistered index
- Closed
- related to
-
SERVER-92366 CollMod on 'expireAfterSeconds' is a no-op if new value is old value truncated to int
- Closed
-
SERVER-77828 listIndexes should report expireAfterSeconds as a float
- Closed
-
SERVER-80442 Remove logic to fix invalid expireAfterSeconds values post-creation
- Open