[SERVER-40965] createIndexes should set the latest optime on its opCtx to meet writeConcern if no indexes are found to need building Created: 02/May/19  Updated: 29/Oct/23  Resolved: 03/Jul/19

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

Type: Improvement 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-27067 Some Commands do not wait for write c... Closed
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2019-07-15
Participants:

 Description   

I haven't tested this, only code inspection, but createIndexes returns OK if it find all indexes to already exist / be being built. I don't see any code setting the latest optime on the opCtx, so I think we are not going to wait for writeConcern correctly if no writes are done by the operation thread.

Foreground index builds would have been misbehaving, since they could block behind other foreground builds and then see that everything is already built and return without a write.

With SERVER-40927, to wait for background index builds to finish before returning, we'll have the same problem as foreground.

This would be a longstanding issue, if it does exist.



 Comments   
Comment by Githook User [ 03/Jul/19 ]

Author:

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

Message: SERVER-40965 ensure noop index build request receives index already exists response in noop_writes_wait_for_write_concern.js
Branch: master
https://github.com/mongodb/mongo/commit/e0e16fe793c8cc64e1075e0af5179f76b9479bca

Comment by Benety Goh [ 02/Jul/19 ]

The JS test noop_writes_wait_for_write_concern.js contains a createIndexes test case that seems to cover the scenario described in this ticket. This test was added, together with some fixes for write concern handling across all commands, in SERVER-27067.

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