[SERVER-68739] Add WiredTiger session statistic without affecting slow op statistics Created: 11/Aug/22  Updated: 29/Oct/23  Resolved: 21/Nov/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.0.15, 6.2.0-rc2, 6.3.0-rc0, 6.0.5

Type: Improvement Priority: Major - P3
Reporter: Sulabh Mahajan 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
is depended on by SERVER-61909 Hang inserting or deleting document w... Closed
Related
is related to SERVER-68853 Remove invariant that a session stat ... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v6.2, v6.0, v5.0
Sprint: Execution Team 2022-10-31, Execution Team 2022-11-14, Execution Team 2022-11-28
Participants:
Linked BF Score: 40

 Description   

WiredTiger has some statistics that are maintained for each session. They are tightly coupled to the storage section of the slow operation statistics in the server. This prevents adding session statistics in WiredTiger without addressing that statistic in the server. Here is an example from WT-8848:

WT-8848 wants to add a new statistic, bytes dirtied by a transaction. But doing so trips the invariant in the server as there is a hard coded map between server's expectation and the sessions statistics.

Also, fetching the statistics causes all the stats to be reset to 0. This is okay when there is one operation per transaction. In the case of MongoDB multi-doc transactions, there could be several WiredTiger operations at the end of which these stats get reset to 0. The server accumulates these stats for the purpose of logging. If we were to decouple the slow operation stats known to the server from the WiredTiger's session statistics, we will have to make sure there is a workaround for not mistakenly resetting all the statistics to zero. So, in this case, the dirtied bytes by the transaction should not be reset to zero until the end of the multi-doc transaction.



 Comments   
Comment by Githook User [ 23/Jan/23 ]

Author:

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

Message: SERVER-68739 Do not reset WT session stats when fetching op stats

(cherry picked from commit 007aef8fa15b3c54019708ddaa36098d61462e06)
Branch: v5.0
https://github.com/mongodb/mongo/commit/52e0ccbe64eb8f5cebe1c2446dfffbba0b784a5c

Comment by Githook User [ 17/Jan/23 ]

Author:

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

Message: SERVER-68739 Do not reset WT session stats when fetching op stats

(cherry picked from commit 007aef8fa15b3c54019708ddaa36098d61462e06)
Branch: v6.0
https://github.com/mongodb/mongo/commit/e28b9fd374a474b2270737607a9408b04cb09677

Comment by Githook User [ 29/Nov/22 ]

Author:

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

Message: SERVER-68739 Do not reset WT session stats when fetching op stats
Branch: v6.2
https://github.com/mongodb/mongo/commit/8045c4a7772ab588679cdbf604a2875c27d97251

Comment by Githook User [ 21/Nov/22 ]

Author:

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

Message: SERVER-68739 Do not reset WT session stats when fetching op stats
Branch: master
https://github.com/mongodb/mongo/commit/007aef8fa15b3c54019708ddaa36098d61462e06

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