indexesToBuild value is 0 in the $currentOp output of resharding unless you run $currentop in the building index phase

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Cluster Scalability
    • ALL
    • Hide

      The collection has 5 indexes but indexesToBuild shows 0 unless the $currentop monitoring is run in building-index phase. 

       

      Atlas [mongos] testdb> db.getSiblingDB("admin").aggregate([ { $currentOp: { allUsers: true, localOps: false } }, { $match: { type: "op", "originatingCommand.reshardCollection": "testdb.foo" } }] ) [ { shard: 'config', totalCopyTimeElapsedSecs: Long('0'), totalApplyTimeElapsedSecs: Long('0'), totalCriticalSectionTimeElapsedSecs: Long('0'), totalIndexBuildTimeElapsedSecs: Long('0'), type: 'op', desc: 'ReshardingMetricsDonorService ae27a28b-2a82-428a-8377-690e0ecbc29a', op: 'command', ns: 'testdb.foo', originatingCommand: { reshardCollection: 'testdb.foo', key: { sk1: 1 }, unique: 'false', collation: { locale: 'simple' } }, totalOperationTimeElapsedSecs: Long('52'), donorState: 'donating-initial-data', countWritesDuringCriticalSection: Long('0'), countReadsDuringCriticalSection: Long('0'), provenance: 'reshardCollection' }, { shard: 'config', totalCopyTimeElapsedSecs: Long('52'), totalApplyTimeElapsedSecs: Long('0'), totalCriticalSectionTimeElapsedSecs: Long('0'), totalIndexBuildTimeElapsedSecs: Long('0'), isSameKeyResharding: false, type: 'op', desc: 'ReshardingMetricsCoordinatorService ae27a28b-2a82-428a-8377-690e0ecbc29a', op: 'command', ns: 'testdb.foo', originatingCommand: { reshardCollection: 'testdb.foo', key: { sk1: 1 }, unique: 'false', collation: { locale: 'simple' } }, totalOperationTimeElapsedSecs: Long('52'), coordinatorState: 'cloning', provenance: 'reshardCollection' }, { shard: 'config', totalCopyTimeElapsedSecs: Long('51'), totalApplyTimeElapsedSecs: Long('0'), totalCriticalSectionTimeElapsedSecs: Long('0'), totalIndexBuildTimeElapsedSecs: Long('0'), indexesToBuild: Long('0'), indexesBuilt: Long('0'), oplogEntriesFetched: Long('52'), oplogEntriesApplied: Long('0'), insertsApplied: Long('0'), updatesApplied: Long('0'), deletesApplied: Long('0'), type: 'op', desc: 'ReshardingMetricsRecipientService ae27a28b-2a82-428a-8377-690e0ecbc29a', op: 'command', ns: 'testdb.foo', originatingCommand: { reshardCollection: 'testdb.foo', key: { sk1: 1 }, unique: 'false', collation: { locale: 'simple' } }, totalOperationTimeElapsedSecs: Long('52'), recipientState: 'cloning', remainingOperationTimeEstimatedSecs: Long('51'), approxDocumentsToCopy: Long('10000'), approxBytesToCopy: Long('11568469'), bytesCopied: Long('11568469'), countWritesToStashCollections: Long('0'), documentsCopied: Long('10000'), provenance: 'reshardCollection' } ] 
       
      Atlas [mongos] testdb> db.foo.getIndexes() 
      [ { v: 2, key: { _id: 1 }, name: '_id_' }, { v: 2, key: { _id: 'hashed' }, name: '_id_hashed' }, { v: 2, key: { index1: 1 }, name: 'index1_1' }, { v: 2, key: { index2: 1 }, name: 'index2_1' }, { v: 2, key: { index3: 1 }, name: 'index3_1' } ]

       

      Show
      The collection has 5 indexes but indexesToBuild shows 0 unless the $currentop monitoring is run in building-index phase.    Atlas [mongos] testdb> db.getSiblingDB( "admin" ).aggregate([ { $currentOp: { allUsers: true , localOps: false } }, { $match: { type: "op" , "originatingCommand.reshardCollection" : "testdb.foo" } }] ) [ { shard: 'config' , totalCopyTimeElapsedSecs: Long ( '0' ), totalApplyTimeElapsedSecs: Long ( '0' ), totalCriticalSectionTimeElapsedSecs: Long ( '0' ), totalIndexBuildTimeElapsedSecs: Long ( '0' ), type: 'op' , desc: 'ReshardingMetricsDonorService ae27a28b-2a82-428a-8377-690e0ecbc29a' , op: 'command' , ns: 'testdb.foo' , originatingCommand: { reshardCollection: 'testdb.foo' , key: { sk1: 1 }, unique: ' false ' , collation: { locale: 'simple' } }, totalOperationTimeElapsedSecs: Long ( '52' ), donorState: 'donating-initial-data' , countWritesDuringCriticalSection: Long ( '0' ), countReadsDuringCriticalSection: Long ( '0' ), provenance: 'reshardCollection' }, { shard: 'config' , totalCopyTimeElapsedSecs: Long ( '52' ), totalApplyTimeElapsedSecs: Long ( '0' ), totalCriticalSectionTimeElapsedSecs: Long ( '0' ), totalIndexBuildTimeElapsedSecs: Long ( '0' ), isSameKeyResharding: false , type: 'op' , desc: 'ReshardingMetricsCoordinatorService ae27a28b-2a82-428a-8377-690e0ecbc29a' , op: 'command' , ns: 'testdb.foo' , originatingCommand: { reshardCollection: 'testdb.foo' , key: { sk1: 1 }, unique: ' false ' , collation: { locale: 'simple' } }, totalOperationTimeElapsedSecs: Long ( '52' ), coordinatorState: 'cloning' , provenance: 'reshardCollection' }, { shard: 'config' , totalCopyTimeElapsedSecs: Long ( '51' ), totalApplyTimeElapsedSecs: Long ( '0' ), totalCriticalSectionTimeElapsedSecs: Long ( '0' ), totalIndexBuildTimeElapsedSecs: Long ( '0' ), indexesToBuild: Long ( '0' ), indexesBuilt: Long ( '0' ), oplogEntriesFetched: Long ( '52' ), oplogEntriesApplied: Long ( '0' ), insertsApplied: Long ( '0' ), updatesApplied: Long ( '0' ), deletesApplied: Long ( '0' ), type: 'op' , desc: 'ReshardingMetricsRecipientService ae27a28b-2a82-428a-8377-690e0ecbc29a' , op: 'command' , ns: 'testdb.foo' , originatingCommand: { reshardCollection: 'testdb.foo' , key: { sk1: 1 }, unique: ' false ' , collation: { locale: 'simple' } }, totalOperationTimeElapsedSecs: Long ( '52' ), recipientState: 'cloning' , remainingOperationTimeEstimatedSecs: Long ( '51' ), approxDocumentsToCopy: Long ( '10000' ), approxBytesToCopy: Long ( '11568469' ), bytesCopied: Long ( '11568469' ), countWritesToStashCollections: Long ( '0' ), documentsCopied: Long ( '10000' ), provenance: 'reshardCollection' } ]   Atlas [mongos] testdb> db.foo.getIndexes() [ { v: 2, key: { _id: 1 }, name: '_id_' }, { v: 2, key: { _id: 'hashed' }, name: '_id_hashed' }, { v: 2, key: { index1: 1 }, name: 'index1_1' }, { v: 2, key: { index2: 1 }, name: 'index2_1' }, { v: 2, key: { index3: 1 }, name: 'index3_1' } ]  
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      indexesToBuild value is 0 in the $currentOp output of resharding unless you run $currentop in the building index phase. We should print the number of indexes to be built from the start. 

            Assignee:
            Unassigned
            Reporter:
            Ratika Gandhi
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: