summaryrefslogtreecommitdiff
path: root/src/mongo
diff options
context:
space:
mode:
authorEsha Maharishi <esha.maharishi@mongodb.com>2019-10-03 19:39:45 +0000
committerevergreen <evergreen@mongodb.com>2019-10-03 19:39:45 +0000
commit2d671ab90e0282773ea89f1860705503dd5bf74d (patch)
tree13f060fcd7062f50ce251b8f7d9bf1055fd22c9f /src/mongo
parentbc734bbd61ea5e07301f1f05c83db08641453201 (diff)
downloadmongo-2d671ab90e0282773ea89f1860705503dd5bf74d.tar.gz
SERVER-39763 transactions_target_at_point_in_time.js should disable expiring old chunk history
(cherry picked from commit 688368b4440c18bd048f122d8a729c26e9ad4a6e)
Diffstat (limited to 'src/mongo')
-rw-r--r--src/mongo/db/s/config/sharding_catalog_manager_chunk_operations.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mongo/db/s/config/sharding_catalog_manager_chunk_operations.cpp b/src/mongo/db/s/config/sharding_catalog_manager_chunk_operations.cpp
index 86aa76b89dc..a1bd16dc8b8 100644
--- a/src/mongo/db/s/config/sharding_catalog_manager_chunk_operations.cpp
+++ b/src/mongo/db/s/config/sharding_catalog_manager_chunk_operations.cpp
@@ -58,6 +58,7 @@ namespace mongo {
namespace {
MONGO_FAIL_POINT_DEFINE(migrationCommitVersionError);
+MONGO_FAIL_POINT_DEFINE(skipExpiringOldChunkHistory);
/**
* Append min, max and version information from chunk to the buffer for logChange purposes.
@@ -684,10 +685,12 @@ StatusWith<BSONObj> ShardingCatalogManager::commitChunkMigration(
// Update the history of the migrated chunk.
// Drop the history that is too old (10 seconds of history for now).
// TODO SERVER-33831 to update the old history removal policy.
- while (!newHistory.empty() &&
- newHistory.back().getValidAfter().getSecs() + kHistorySecs <
- validAfter.get().getSecs()) {
- newHistory.pop_back();
+ if (!MONGO_FAIL_POINT(skipExpiringOldChunkHistory)) {
+ while (!newHistory.empty() &&
+ newHistory.back().getValidAfter().getSecs() + kHistorySecs <
+ validAfter.get().getSecs()) {
+ newHistory.pop_back();
+ }
}
if (!newHistory.empty() && newHistory.front().getValidAfter() >= validAfter.get()) {