[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: |
|
||||||||||||||||
| 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: (cherry picked from commit 2d07f31853fac1e9496be12523c8e7a72dccd81f) |
| Comment by Githook User [ 04/Oct/23 ] |
|
Author: {'name': 'Yu Jin Kang Park', 'email': 'yujin.kang@mongodb.com', 'username': 'ykangpark'}Message: (cherry picked from commit 2d07f31853fac1e9496be12523c8e7a72dccd81f) |
| Comment by Yujin Kang Park [ 16/May/23 ] |
|
Requesting 5.0 and 4.4 backports too as |
| Comment by Githook User [ 14/Apr/23 ] |
|
Author: {'name': 'Yu Jin Kang Park', 'email': 'yujin.kang@mongodb.com', 'username': 'ykangpark'}Message: (cherry picked from commit 2d07f31853fac1e9496be12523c8e7a72dccd81f) |
| Comment by Githook User [ 20/Mar/23 ] |
|
Author: {'name': 'Yu Jin Kang Park', 'email': 'yujin.kang@mongodb.com', 'username': 'ykangpark'}Message: (cherry picked from commit 2d07f31853fac1e9496be12523c8e7a72dccd81f) |
| Comment by Githook User [ 24/Feb/23 ] |
|
Author: {'name': 'Yu Jin Kang Park', 'email': 'yujin.kang@mongodb.com', 'username': 'ykangpark'}Message: |
| Comment by Dianna Hohensee (Inactive) [ 23/Feb/23 ] |
|
Author: {'name': 'Dianna Hohensee', 'email': 'dianna.hohensee@mongodb.com', 'username': 'DiannaHohensee'} This reverts commit 4fedf80d4847e2f668ed5db555bf8e6551bf95d2. |