[SERVER-34686] `dropIndex` blocks secondary if it is executing `createIndexes` currently Created: 26/Apr/18  Updated: 08/May/18  Resolved: 26/Apr/18

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

Type: Bug Priority: Major - P3
Reporter: Sergey Zagursky Assignee: Kelsey Schubert
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File scratch_18.json    
Issue Links:
Duplicate
duplicates SERVER-21307 Replicated DDL (catalog) operation du... Closed
Operating System: ALL
Steps To Reproduce:

To reproduce the questionable behavior we'll need:

  1. MongoDB replicaset with primary instance and at least one secondary instance.
  2. Sufficiently large collection t for enough time to be available for observation.
  3. Some index already built on that collection. E. g. db.t.createIndex({foo:1})

Steps to reproduce are:

  1. Start building new index on the collection.
    db.t.createIndex({foo:1,_id:1})
  2. Wait until primary reports index build completion.
  3. Drop unique index before secondaries catch up with building new index. db.t.dropIndex('foo_1').
Participants:

 Description   

Observed behavior is:

  • Secondary mongod instances block on Global lock and effectively all operations except building index are waiting for Global lock.
  • Replication is effectively paused.
  • Due to replication pause all operations with writeConcern:majority on the primary instance are blocked. E. g. db.t.insertOne({foo:1}, {w:'majority'}) will hang until one of secondaries catch up with primary.
  • All read operations with readPreference set to secondaryPreferred also hang until indices are built on that secondary. E. g.
    db.getMongo().setReadPref('secondaryPreferred');
    db.t.find();
    will hang.

Results of db.currentOp() from secondary instance with hanged db.t.find() are attached to the issue.

This behavior is very surprising and isn't documented, so I consider it a bug.



 Comments   
Comment by Sergey Zagursky [ 26/Apr/18 ]

Yes, highly likely.

Comment by James Wahlin [ 26/Apr/18 ]

I believe this is a duplicate of SERVER-21307.

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