summaryrefslogtreecommitdiff
path: root/src/mongo/s/commands/cluster_write.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/s/commands/cluster_write.cpp')
-rw-r--r--src/mongo/s/commands/cluster_write.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mongo/s/commands/cluster_write.cpp b/src/mongo/s/commands/cluster_write.cpp
index 8b8a3f2e644..b17035993d9 100644
--- a/src/mongo/s/commands/cluster_write.cpp
+++ b/src/mongo/s/commands/cluster_write.cpp
@@ -499,7 +499,11 @@ void updateChunkWriteStatsAndSplitIfNeeded(OperationContext* opCtx,
} catch (const DBException& ex) {
chunk->randomizeBytesWritten();
- log() << "Unable to auto-split chunk " << redact(chunkRange.toString()) << causedBy(ex);
+ if (ErrorCodes::isStaleShardingError(ErrorCodes::Error(ex.getCode()))) {
+ log() << "Unable to auto-split chunk " << redact(chunkRange.toString()) << causedBy(ex)
+ << ", going to invalidate routing table entry for " << nss;
+ Grid::get(opCtx)->catalogCache()->invalidateShardedCollection(nss);
+ }
}
}