[SERVER-37964] Track the wall clock time when an index build begins Created: 06/Nov/18  Updated: 29/Oct/23  Resolved: 10/Dec/18

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 4.1.7

Type: Task Priority: Major - P3
Reporter: Dianna Hohensee (Inactive) Assignee: Benety Goh
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-37965 Enable the index builder to update th... Closed
Backwards Compatibility: Fully Compatible
Sprint: Storage NYC 2018-12-17
Participants:

 Description   

We want to report how long an index build has been running in order to report it in currentOp output.

I'm not sure what behavior we want if a mongod restarts, whether to restart the start time or persist the start time so that it can be found on startup. This needs to be explored, possibly with Cloud people.



 Comments   
Comment by Benety Goh [ 10/Dec/18 ]

We added the call to CurOp::ensureStarted() in SERVER-37965. See:

https://github.com/mongodb/mongo/blob/b18a6b96d0c28bc98a1e16b7de0d5f104fd3c937/src/mongo/db/catalog/multi_index_block_impl.cpp#L781

Comment by Benety Goh [ 05/Dec/18 ]

Using CurOp::ensureStarted() to add the secs_running and microsecs_running fields to the CurOp output might be sufficient to satisfy the goals of this ticket:

Sample output:

     "secs_running" : NumberLong(0),
     "microsecs_running" : NumberLong(132064),
     "op" : "command",
     "ns" : "test.test",
     "command" : {
         "createIndexes" : "test",
         "indexes" : [
...

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