[SERVER-68522] Prevent 5.0 binary from starting in FCV 4.4 with misconfigured TTL index Created: 02/Aug/22  Updated: 29/Oct/23  Resolved: 08/Aug/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.0.11

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

Issue Links:
Depends
Problem/Incident
Related
is related to SERVER-56676 improve handling of large/NaN values ... Closed
is related to SERVER-68477 Improve NaN-handling for expireAfterS... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Execution Team 2022-08-08, Execution Team 2022-08-22
Participants:

 Description   

TTL indexes configured with a NaN for the expireAfterSeconds options are handled differently in 5.0+ binaries by the TTL Monitor for the purposes of calculating an expiration date for the indexed documents. To avoid a mix of 5.0 and 4.4 behaviors for these misconfigured TTL indexes, we should detect these indexes during the upgrade and downgrade steps and fail accordingly.

With this fix, MongoDB 5.0.11 will:

  • Log an error and crash on start-up if it's running in FCV 4.4 and detects a bad index. In addition to clusters upgrading directly from version 4.4, this includes clusters running featureCompatibilityVersion (FCV) 4.4 in versions 5.0.0 - 5.0.10.
  • Fail to create a new misconfigured TTL index (either via user operation or initial sync) when running FCV 4.4.
  • Start properly and allow the creation of new misconfigured TTL indexes when running FCV 5.0, and treat this configuration as expireAfterSeconds: 0, preserving behavior from versions 5.0.0-5.0.10.
  • Fail to downgrade to FCV 4.4 if a misconfigured TTL index exists.

To avoid any of these problematic behaviors, do not use expireAfterSeconds: NaN.



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

Author:

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

Message: SERVER-68522 Prevent 5.0 binary from starting in FCV 4.4 with misconfigured TTL index
Branch: v5.0
https://github.com/mongodb/mongo/commit/abdedd367e2f331816354563f8ae95f6bb35c51d

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