[SERVER-39335] IndexBuildsCoordinator::_runIndexBuild() hangs while transitioning from SECONDARY to PRIMARY Created: 01/Feb/19  Updated: 29/Oct/23  Resolved: 04/Feb/19

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

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

Attachments: Text File backtrace.txt    
Issue Links:
Related
related to SERVER-44436 IndexBuildsCoordinatorMongod should a... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Storage NYC 2019-02-11
Participants:

 Description   

This depends on code in SERVER-39329 that is not enabled in master and affects sharded configurations only.

This issue may be reproduced using the JS test jstests/sharding/shard_collection_basic.js.

On stepping up to a primary, a secondary may hang while building an index on the config.chunks collection:

[js_test:shard_collection_basic] 2019-02-01T13:30:26.932-0500 c20022| 2019-02-01T13:30:26.932-0500 I ELECTION [replexec-0] election succeeded, assuming primary role in term 1
[js_test:shard_collection_basic] 2019-02-01T13:30:26.933-0500 c20022| 2019-02-01T13:30:26.932-0500 I REPL     [replexec-0] transition to PRIMARY from SECONDARY
[js_test:shard_collection_basic] 2019-02-01T13:30:26.933-0500 c20022| 2019-02-01T13:30:26.932-0500 I REPL     [replexec-0] Resetting sync source to empty, which was :27017
[js_test:shard_collection_basic] 2019-02-01T13:30:26.933-0500 c20022| 2019-02-01T13:30:26.932-0500 I REPL     [replexec-0] Entering primary catch-up mode.
[js_test:shard_collection_basic] 2019-02-01T13:30:26.933-0500 c20022| 2019-02-01T13:30:26.932-0500 I REPL     [replexec-0] Exited primary catch-up mode.
[js_test:shard_collection_basic] 2019-02-01T13:30:26.933-0500 c20022| 2019-02-01T13:30:26.932-0500 I REPL     [replexec-0] Stopping replication producer
[js_test:shard_collection_basic] 2019-02-01T13:30:28.903-0500 c20022| 2019-02-01T13:30:28.903-0500 I STORAGE  [rsSync-0] createCollection: config.chunks with provided UUID: adc2cada-d023-43b1-b9fb-8b067e8599cb
[js_test:shard_collection_basic] 2019-02-01T13:30:28.934-0500 c20022| 2019-02-01T13:30:28.934-0500 I INDEX    [rsSync-0] index build: done building index _id_ on ns config.chunks
[js_test:shard_collection_basic] 2019-02-01T13:30:28.934-0500 c20022| 2019-02-01T13:30:28.934-0500 I INDEX    [rsSync-0] Registering index build: 735e14b6-8fc4-4200-846c-32f1a70075fa
[js_test:shard_collection_basic] 2019-02-01T13:30:28.934-0500 c20022| 2019-02-01T13:30:28.934-0500 I INDEX    [rsSync-0] Waiting for index build to complete: 735e14b6-8fc4-4200-846c-32f1a70075fa
[js_test:shard_collection_basic] 2019-02-01T13:30:28.934-0500 c20022| 2019-02-01T13:30:28.934-0500 I STORAGE  [IndexBuildsCoordinatorMongod-0] Index builds manager starting: 735e14b6-8fc4-4200-846c-32f1a70075fa: config.chunks (adc2cada-d023-43b1-b9fb-8b067e8599cb)
(no further progress)

See attached backtrace.txt for thread state.



 Comments   
Comment by Githook User [ 04/Feb/19 ]

Author:

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

Message: SERVER-39335 IndexBuildsCoordinatorMongod runs index build on caller thread during replication mode transitions
Branch: master
https://github.com/mongodb/mongo/commit/d91c34c59b2fd8ca01412bca14fd6acbf2bd7b40

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