Operational Defect Database

BugZero found this defect 356 days ago.

MongoDB | 2352632

Internal operations should handle TemporarilyUnavailable and TransactionTooLargeForCache exceptions

Last update date:

3/12/2024

Affected products:

MongoDB Server

Affected releases:

No affected releases provided.

Fixed releases:

7.2.0-rc0

7.0.2

7.1.0-rc2

Description:

Info

Unlike user operations which transparently handle both WriteConflictException (WCE) and (TemprorarilyUnavailableException) TUE via the writeConflictRetry helper, internal operations tend to use custom code that handles WCE's only; oplog truncation is an example. Excerpt from an internal stress test: {"t":{"$date":"2023-05-12T18:06:13.149+00:00"},"s":"F", "c":"STORAGE", "id":6761100, "ctx":"OplogCapMaintainerThread-local.oplog.rs","msg":"Error in OplogCapMaintainerThread","attr":{"error":{"code":365,"codeName":"TemporarilyUnavailable","errmsg":"-31800: oldest pinned transaction ID rolled back for eviction"}}} We should audit the code for missing TUE handling and consider adopting the writeConflictRetry helper or implementing an equivalent one for internal operations.

Top User Comments

xgen-internal-githook commented on Thu, 7 Sep 2023 17:54:03 +0000: Author: {'name': 'Josef Ahmad', 'email': 'josef.ahmad@mongodb.com', 'username': 'josefahmad'} Message: SERVER-77542 Handle TemporarilyUnavailable and TransactionTooLargeForCache as write conflicts for internal operations (cherry picked from commit 2ed9c7d078e499a02f67c8a8199c4d84fe8dedd9) Branch: v7.0 https://github.com/mongodb/mongo/commit/bed7540a361f88e17d086e1698ca42bd995c9132 xgen-internal-githook commented on Thu, 7 Sep 2023 16:37:30 +0000: Author: {'name': 'Josef Ahmad', 'email': 'josef.ahmad@mongodb.com', 'username': 'josefahmad'} Message: SERVER-77542 Make internal ops handle TemporarilyUnavailable and TransactionTooLargeForCache exceptions (cherry picked from commit 02d317cf8ab124ec10880d2cd6232035c731e40e) Branch: v7.0 https://github.com/mongodb/mongo/commit/d8b33e75cb965b5adb9b405198b7837b4757a6b9 xgen-internal-githook commented on Wed, 6 Sep 2023 13:10:13 +0000: Author: {'name': 'Josef Ahmad', 'email': 'josef.ahmad@mongodb.com', 'username': 'josefahmad'} Message: SERVER-77542 Handle TemporarilyUnavailable and TransactionTooLargeForCache as write conflicts for internal operations (cherry picked from commit 2ed9c7d078e499a02f67c8a8199c4d84fe8dedd9) Branch: v7.1 https://github.com/mongodb/mongo/commit/c90c98cb81a0e1d2f8609c3e60f4db833e099433 xgen-internal-githook commented on Fri, 1 Sep 2023 11:00:51 +0000: Author: {'name': 'Josef Ahmad', 'email': 'josef.ahmad@mongodb.com', 'username': 'josefahmad'} Message: SERVER-77542 Handle TemporarilyUnavailable and TransactionTooLargeForCache as write conflicts for internal operations Branch: master https://github.com/mongodb/mongo/commit/2ed9c7d078e499a02f67c8a8199c4d84fe8dedd9 josef.ahmad commented on Mon, 7 Aug 2023 15:13:25 +0000: Reopening due to an issue with converting the TemporarilyUnavailableException into a WriteConflictException. We should handle the TUE as a WCE instead of throwing a WCE, otherwise the write conflict escapes to the caller. josef.ahmad commented on Wed, 19 Jul 2023 06:04:13 +0000: This ticket introduces a base StorageUnavailableException encompassing WriteConflictException, TemporarilyUnavailableException, and TransactionTooLargeForCacheException. This base exception is used to catch the three derived exceptions for internal operations where the standard policy implemented by the writeConflictRetry helper does not apply. This is an internal change only; there are no externally-visible changes. xgen-internal-githook commented on Tue, 18 Jul 2023 21:51:22 +0000: Author: {'name': 'Josef Ahmad', 'email': 'josef.ahmad@mongodb.com', 'username': 'josefahmad'} Message: SERVER-77542 Make internal ops handle TemporarilyUnavailable and TransactionTooLargeForCache exceptions Branch: master https://github.com/mongodb/mongo/commit/02d317cf8ab124ec10880d2cd6232035c731e40e

Steps to Reproduce


Additional Resources / Links

Share:

BugZero® Risk Score

What's this?

Coming soon

Status

Closed

Learn More

Search:

...