[SERVER-71985] Automatically retry time series insert on DuplicateKey error Created: 09/Dec/22  Updated: 29/Oct/23  Resolved: 06/Apr/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.0.0-rc0, 6.3.2, 6.0.7, 5.0.19

Type: Improvement Priority: Major - P3
Reporter: Dan Larkin-York Assignee: Yuhong Zhang
Resolution: Fixed Votes: 0
Labels: michael-preferred, time-series
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
related to SERVER-79397 Fix and test logic to internally retr... Closed
Assigned Teams:
Storage Execution
Backwards Compatibility: Fully Compatible
Backport Requested:
v6.3, v6.0, v5.0
Sprint: Execution Team 2023-03-20, Execution Team 2023-04-03, Execution Team 2023-04-17
Participants:
Case:

 Description   

Due to the way we generate time series bucket _id values, it's possible that some inserts to time series collection will see unexpected DuplicateKey errors. For the most part, these errors are transient and retrying the insert will succeed. Some of our users already use this workaround. We can automate it by automatically retrying the the operation internally.

The only caveat is that in some degenerate cases, the retry may not succeed, or may only succeed with very low probability, so we should limit the number of retries (unlike a WriteConflict where we'll retry indefinitely).



 Comments   
Comment by Githook User [ 22/Jun/23 ]

Author:

{'name': 'Dan Larkin-York', 'email': 'dan.larkin-york@mongodb.com', 'username': 'dhly-etc'}

Message: SERVER-71985 Automatically retry time series insert on DuplicateKey error

(cherry picked from commit f181b82f053bf4a167c139df976edae2dc708688)
Branch: v6.3
https://github.com/mongodb/mongo/commit/067533f935c44a94609d4d9f90c4b616429751f3

Comment by Githook User [ 25/May/23 ]

Author:

{'name': 'Yuhong Zhang', 'email': 'yuhong.zhang@mongodb.com', 'username': 'YuhongZhang98'}

Message: SERVER-71985 Automatically retry time-series insert on DuplicateKey error

(cherry picked from commit f181b82f053bf4a167c139df976edae2dc708688)
Branch: v5.0
https://github.com/mongodb/mongo/commit/af5c633bbb0512631da0180d6ddd091f6b210e75

Comment by Githook User [ 02/May/23 ]

Author:

{'name': 'Yuhong Zhang', 'email': 'yuhong.zhang@mongodb.com', 'username': 'YuhongZhang98'}

Message: SERVER-71985 Automatically retry time-series insert on DuplicateKey error

(cherry picked from commit f181b82f053bf4a167c139df976edae2dc708688)
Branch: v6.0
https://github.com/mongodb/mongo/commit/f88124a50e4d13603bb71b29c458eac717365cd8

Comment by Githook User [ 06/Apr/23 ]

Author:

{'name': 'Yuhong Zhang', 'email': 'yuhong.zhang@mongodb.com', 'username': 'YuhongZhang98'}

Message: SERVER-71985 Automatically retry time-series insert on DuplicateKey error
Branch: master
https://github.com/mongodb/mongo/commit/f181b82f053bf4a167c139df976edae2dc708688

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