summaryrefslogtreecommitdiff
path: root/src/mongo/s
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/s')
-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 cb3c5282252..0bc72d6fd7c 100644
--- a/src/mongo/s/commands/cluster_write.cpp
+++ b/src/mongo/s/commands/cluster_write.cpp
@@ -454,7 +454,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);
+ }
}
}