[SERVER-68359] Prevent TTLMonitor from processing index if expireAfterSeconds is NaN Created: 27/Jul/22  Updated: 29/Oct/23  Resolved: 03/Aug/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.2.23, 4.4.16

Type: Bug Priority: Major - P3
Reporter: Benety Goh Assignee: Benety Goh
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Problem/Incident
Related
related to SERVER-68477 Improve NaN-handling for expireAfterS... Closed
related to SERVER-68487 add BSONElement method to check for N... Closed
is related to SERVER-56676 improve handling of large/NaN values ... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v6.0, v5.0, v4.4, v4.2
Sprint: Execution Team 2022-08-08
Participants:
Case:

 Description   

The TTLMonitor is responsible for removing expired documents from a collection with a TTL index. The expireAfterSeconds option is a numerical value that is used to calculate the expiration time for removing documents.

In 5.0 (see SERVER-56676), the TTL Monitor was updated to handle values that fall outside the long long range. However, because BSONElement::safeNumberLong() returns 0 for NaN values, SERVER-56676 sets the TTL expiration so that documents are expired immediately.

In versions before 5.0, the handling of NaN values for the expireAfterSeconds field is platform-dependent.



 Comments   
Comment by Benety Goh [ 04/Aug/22 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-68359 TTL monitor skips indexes with NaN expireAfterSeconds
Branch: v4.2
https://github.com/mongodb/mongo/commit/bcf69685f033632e55780c36d64fb28574044f87

Comment by Githook User [ 03/Aug/22 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-68359 TTL monitor skips indexes with NaN expireAfterSeconds
Branch: v4.4
https://github.com/mongodb/mongo/commit/14c07b53186ee88497abd0ba492d2d9157891718

Generated at Thu Feb 08 06:10:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.