[SERVER-55652] dbStats command can fail if an index is bulk loading Created: 30/Mar/21  Updated: 29/Oct/23  Resolved: 16/Aug/21

Status: Closed
Project: Core Server
Component/s: Catalog
Affects Version/s: None
Fix Version/s: 5.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Eric Milkie Assignee: Benety Goh
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Duplicate
Related
is related to SERVER-32876 Don't stall ftdc due to WT cache full Closed
is related to SERVER-42037 Expose WiredTiger block-manager stats... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

1. Add a pause to the WiredTigerIndex::BulkBuilder::openBulkCursor after a cursor has been successfully opened.
2. Run mongod and build an index; observe the index build hanging.
3. In another connected shell, attempt to run dbStats on the db containing the collection with the index being built. Result:

> db.runCommand({dbStats:1})
{
	"ok" : 0,
	"errmsg" : "unable to open cursor at URI statistics:table:index-0-4936792770501023666. reason: Device or resource busy",
	"code" : 43,
	"codeName" : "CursorNotFound"
}

Sprint: Execution Team 2021-08-23
Participants:

 Description   

Part of the dbStats command is to collect index sizes, which attempts to open a statistics cursor on every index table. This can fail if an index table happens to be locked with a bulk-index-load cursor.

Note that we should probably audit all places that iterate through indexes like this and ensure all of them are prepared for such an error to be returned from a statistics cursor (simply skipping over such indexes sounds reasonable).



 Comments   
Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 14/Aug/21 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-55652 use non-transactional WT session to get index stats for dbStats command

This makes WiredTigerIndex::getFreeStorageBytes() more consistent with
WiredTigerRecordStore::freeStorageSize() in how it obtains a session
for querying WT statistics.

See commits 989d23805572e6db103b64f3de76ffa7359a00cd and d368f071651856039f2637202c122b1a55a44142.
Branch: master
https://github.com/mongodb/mongo/commit/dcfb71ae6c7e0f5b2809a4e04bb534a1d6b0ce12

Comment by Githook User [ 13/Aug/21 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-55652 add statistics key to WiredTigerUtil::getStatisticsValue() cursor not found error message
Branch: master
https://github.com/mongodb/mongo/commit/6a02cea7879c8b7a6963b5a88afa711717ef8f00

Generated at Thu Feb 08 05:37:04 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.