Skip to content

Commit 574976d

Browse files
jsmulrowEvergreen Agent
authored andcommitted
SERVER-48600 refineCollectionShardKey internal transaction should check for write concern errors
1 parent be07da4 commit 574976d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/mongo/db/s/config/sharding_catalog_manager_collection_operations.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,11 @@ Status commitTxnForConfigDocument(OperationContext* opCtx, TxnNumber txnNumber)
226226
.get()
227227
.response);
228228

229-
return getStatusFromCommandResult(replyOpMsg.body);
229+
auto commandStatus = getStatusFromCommandResult(replyOpMsg.body);
230+
if (!commandStatus.isOK()) {
231+
return commandStatus;
232+
}
233+
return getWriteConcernStatusFromCommandResult(replyOpMsg.body);
230234
}
231235

232236
void triggerFireAndForgetShardRefreshes(OperationContext* opCtx, const NamespaceString& nss) {
@@ -702,6 +706,7 @@ void ShardingCatalogManager::refineCollectionShardKey(OperationContext* opCtx,
702706
hangRefineCollectionShardKeyBeforeCommit.pauseWhileSet(opCtx);
703707
}
704708

709+
// Note this will wait for majority write concern.
705710
uassertStatusOK(commitTxnForConfigDocument(asr.opCtx(), txnNumber));
706711
}
707712

0 commit comments

Comments
 (0)