[SERVER-74303] Add a sizeStorer call to the onRollback handler for dataSize and numRecords changes Created: 23/Feb/23  Updated: 29/Oct/23  Resolved: 24/Feb/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.0.0-rc0, 6.0.6, 6.3.1, 5.0.22, 4.4.26

Type: Bug Priority: Major - P3
Reporter: Dianna Hohensee (Inactive) Assignee: Yujin Kang Park
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Problem/Incident
is caused by SERVER-71053 Fix dataSize can be negative and inco... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v5.0, v4.4
Sprint: Execution Team 2023-03-06
Participants:
Linked BF Score: 4

 Description   

Finally got to the bottom of this issue. Henrik spotted it.

There's a call to the sizeStorer to tell it that the collection is dirty and must be flushed. The new code doesn't call the flush in onRollback, resulting in exactly what we're seeing where the numRecords is 1 greater than the actual documents. The old code would run the sizeStorer call in the onRollback handler in a very fragile non-obvious manner, via a recursive call into the _increaseDataSize function with a opCtx==nullptr. Additionally, the old _changeNumRecords() function didn't call into the sizeStorer, so the code was entirely dependent on the order of calling first _changeNumRecords() immediately followed by _increaseDataSize().



 Comments   
Comment by Githook User [ 06/Oct/23 ]

Author:

{'name': 'Yu Jin Kang Park', 'email': 'yujin.kang@mongodb.com', 'username': 'ykangpark'}

Message: SERVER-74303 Fix WiredTigerRecordStore not marking sizeInfo dirty on rollback

(cherry picked from commit 2d07f31853fac1e9496be12523c8e7a72dccd81f)
Branch: v4.4
https://github.com/mongodb/mongo/commit/f5ade5979f33f6d030f2fea39aa20e93dfcb7eaa

Comment by Githook User [ 04/Oct/23 ]

Author:

{'name': 'Yu Jin Kang Park', 'email': 'yujin.kang@mongodb.com', 'username': 'ykangpark'}

Message: SERVER-74303 Fix WiredTigerRecordStore not marking sizeInfo dirty on rollback

(cherry picked from commit 2d07f31853fac1e9496be12523c8e7a72dccd81f)
Branch: v5.0
https://github.com/mongodb/mongo/commit/9a7e240ee8981fbb538e91d70d86dd9b99ba4794

Comment by Yujin Kang Park [ 16/May/23 ]

Requesting 5.0 and 4.4 backports too as SERVER-71053 which caused the bug fixed by this ticket was requested for backport to those versions.

Comment by Githook User [ 14/Apr/23 ]

Author:

{'name': 'Yu Jin Kang Park', 'email': 'yujin.kang@mongodb.com', 'username': 'ykangpark'}

Message: SERVER-74303 Fix WiredTigerRecordStore not marking sizeInfo dirty on rollback

(cherry picked from commit 2d07f31853fac1e9496be12523c8e7a72dccd81f)
Branch: v6.3
https://github.com/mongodb/mongo/commit/ad66db6e43327ab2763c1d51b74acde64480d97b

Comment by Githook User [ 20/Mar/23 ]

Author:

{'name': 'Yu Jin Kang Park', 'email': 'yujin.kang@mongodb.com', 'username': 'ykangpark'}

Message: SERVER-74303 Fix WiredTigerRecordStore not marking sizeInfo dirty on rollback

(cherry picked from commit 2d07f31853fac1e9496be12523c8e7a72dccd81f)
Branch: v6.0
https://github.com/mongodb/mongo/commit/028e0cd9013b1947447ef7adfd565cd0be75635d

Comment by Githook User [ 24/Feb/23 ]

Author:

{'name': 'Yu Jin Kang Park', 'email': 'yujin.kang@mongodb.com', 'username': 'ykangpark'}

Message: SERVER-74303 Fix WiredTigerRecordStore not marking sizeInfo dirty on rollback
Branch: master
https://github.com/mongodb/mongo/commit/2d07f31853fac1e9496be12523c8e7a72dccd81f

Comment by Dianna Hohensee (Inactive) [ 23/Feb/23 ]

Author: {'name': 'Dianna Hohensee', 'email': 'dianna.hohensee@mongodb.com', 'username': 'DiannaHohensee'}
Message: Revert "SERVER-71053 Fix WiredTigerRecordStore dataSize inconsistent"

This reverts commit 4fedf80d4847e2f668ed5db555bf8e6551bf95d2.
Branch: v6.0
https://github.com/mongodb/mongo/commit/8df1ddb3073ba851e6e3c1a0b4f0894c685dce03

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