Hi experts:
The MongoDB version is 5.0.9, all ttl indexs is not working in the cluster
Here are the cluster’s informations:
db.testCollection.getIndexes()
[
{ v: 2, key: { _id: 1 }, name: '_id_' },
{
v: 2,
key: { expiresAt: 1 },
name: 'expiresAt_1',
expireAfterSeconds: 120
}
]
db.testCollection.find()
[
{
_id: ObjectId("670e31c46cb5f7ab671ae5e8"),
name: 'document1',
expiresAt: ISODate("2024-10-15T10:11:32.366Z")
},
{
_id: ObjectId("670e31c46cb5f7ab671ae5e9"),
name: 'document2',
expiresAt: ISODate("2024-10-15T09:41:32.366Z")
},
{
_id: ObjectId("670e31c46cb5f7ab671ae5ea"),
name: 'document3',
expiresAt: ISODate("2024-10-15T10:41:32.366Z")
},
{
_id: ObjectId("670e31c46cb5f7ab671ae5eb"),
name: 'document1',
expiresAt: ISODate("2024-10-15T09:12:32.366Z")
},
{
_id: ObjectId("670e31c46cb5f7ab671ae5ec"),
name: 'document2',
expiresAt: ISODate("2024-10-15T09:13:32.366Z")
},
{
_id: ObjectId("670e31c46cb5f7ab671ae5ed"),
name: 'document3',
expiresAt: ISODate("2024-10-15T09:14:32.366Z")
}
]
db.serverStatus().metrics.ttl
{ deletedDocuments: Long("1487129845"), passes: Long("505811") }
# The deleteDocuments field and passes filed is not change in the long time.
db.adminCommand({getParameter:1, ttlMonitorSleepSecs: 1});
{
ttlMonitorSleepSecs: 60,
ok: 1,
'$clusterTime': {
clusterTime: Timestamp({ t: 1729152500, i: 110 }),
signature: {
hash: Binary(Buffer.from("a44b12fcff9d2d5563b9f77d3f8839d9e1ba399e", "hex"), 0),
keyId: Long("7366182217619341331")
}
},
operationTime: Timestamp({ t: 1729152500, i: 110 })
}
db.adminCommand({getParameter:1, ttlMonitorEnabled:1})
{
ttlMonitorEnabled: true,
ok: 1,
'$clusterTime': {
clusterTime: Timestamp({ t: 1729152514, i: 71 }),
signature: {
hash: Binary(Buffer.from("c9b2d0179137db230da7cd723df3fa0ffd3bc198", "hex"), 0),
keyId: Long("7366182217619341331")
}
},
operationTime: Timestamp({ t: 1729152514, i: 71 })
}
In the mongod.log is not have information about “TTLMonitor”, it seems like the TTLMonitor thread is not working.
Please give me some help, Thanks