Skip to content

Commit 8d17660

Browse files
authored
DOCSP-24449 TTL expireAfterSeconds NaN Behavior alert (#1623)
* DOCSP-24449 TTL expireAfterSeconds NaN Behavior alert * tech feedack * link to compat notes from upgrade pre-reqs * internal review feedback
1 parent 653c666 commit 8d17660

File tree

6 files changed

+43
-0
lines changed

6 files changed

+43
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Ensure TTL Config is Valid
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
Ensure that the :ref:`TTL <ttl-collections>` configuration is valid.
5+
Before upgrading, remove or correct any TTL indexes that have
6+
``expireAfterSeconds`` set to ``NaN``. In MongoDB 5.0 and later,
7+
setting ``expireAfterSeconds`` to ``NaN`` has the same effect as
8+
setting ``expireAfterSeconds`` to ``0``. For details, see
9+
:ref:`<ttl_expireAfterSeconds_behavior>`.

source/release-notes/5.0-compatibility.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,23 @@ Starting in MongoDB 5.0, the
136136
present on the :ref:`recipient shard <resharding-process-details>`
137137
when a :ref:`resharding operation <sharding-resharding>` is taking place.
138138

139+
.. _ttl_expireAfterSeconds_behavior:
140+
141+
TTL ``expireAfterSeconds`` Behavior When Set to ``NaN``
142+
-------------------------------------------------------
143+
144+
Setting :ref:`TTL <ttl-collections>` ``expireAfterSeconds`` to ``NaN``
145+
experiences a behavior change from MongoDB 4.4 to MongoDB 5.0 that
146+
affects:
147+
148+
- direct upgrades
149+
- initial sync from earlier versions
150+
- :binary:`~bin.mongorestore` from earlier versions.
151+
152+
Performing any of those actions causes an ``expireAfterSeconds`` of
153+
``NaN`` to be treated as an ``expireAfterSeconds`` of ``0``. Immediate
154+
document expiration may occur as a result.
155+
139156
Shell Changes
140157
-------------
141158

source/release-notes/5.0-upgrade-replica-set.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ The following steps outline the procedure to upgrade a
2929
Prerequisites
3030
-------------
3131

32+
.. include:: /includes/valid-ttl-config-prereq.rst
33+
3234
All Members Version
3335
~~~~~~~~~~~~~~~~~~~
3436

source/release-notes/5.0-upgrade-sharded-cluster.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ to |newversion|.
3030
Prerequisites
3131
-------------
3232

33+
.. include:: /includes/valid-ttl-config-prereq.rst
34+
3335
All Members Version
3436
~~~~~~~~~~~~~~~~~~~
3537

source/release-notes/5.0-upgrade-standalone.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ The following steps outline the procedure to upgrade a standalone
2929
Prerequisites
3030
-------------
3131

32+
.. include:: /includes/valid-ttl-config-prereq.rst
33+
3234
Confirm Clean Shutdown
3335
~~~~~~~~~~~~~~~~~~~~~~
3436

source/release-notes/6.0-compatibility.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,17 @@ MongoDB 6.0 removes the following server parameters:
169169
:doc:`reconfigure your TLS/SSL connections </tutorial/configure-ssl>`
170170
before upgrading.
171171

172+
TTL ``expireAfterSeconds`` Behavior When Set to ``NaN``
173+
-------------------------------------------------------
174+
175+
Setting :ref:`TTL <ttl-collections>` ``expireAfterSeconds`` to ``NaN``
176+
experiences a behavior change from MongoDB 4.4 to MongoDB 6.0 that
177+
affects initial sync from MongoDB 4.4 and earlier and
178+
:binary:`~bin.mongorestore` from MongoDB 4.4 and earlier. Performing
179+
any of those actions causes an ``expireAfterSeconds`` of ``NaN`` to be
180+
treated as an ``expireAfterSeconds`` of ``0``. Immediate document
181+
expiration may occur as a result.
182+
172183
Replica Sets
173184
------------
174185

0 commit comments

Comments
 (0)