summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/resharding
diff options
context:
space:
mode:
authorCheahuychou Mao <mao.cheahuychou@gmail.com>2022-03-22 21:11:04 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-03-22 22:38:45 +0000
commit388669a9def42795bdca598ff67c3c6c8dd7a57e (patch)
tree28ae80918fbcb3f30d94d49f958b086a29d321e9 /src/mongo/db/s/resharding
parent9b6d19aa8cf204a67307611a6333905359b7aa3f (diff)
downloadmongo-388669a9def42795bdca598ff67c3c6c8dd7a57e.tar.gz
SERVER-63877 Resharding should not migrate internal sessions for non-retryable writes to recipients
Diffstat (limited to 'src/mongo/db/s/resharding')
-rw-r--r--src/mongo/db/s/resharding/resharding_oplog_session_application.cpp5
-rw-r--r--src/mongo/db/s/resharding/resharding_oplog_session_application_test.cpp2
-rw-r--r--src/mongo/db/s/resharding/resharding_txn_cloner.cpp5
3 files changed, 6 insertions, 6 deletions
diff --git a/src/mongo/db/s/resharding/resharding_oplog_session_application.cpp b/src/mongo/db/s/resharding/resharding_oplog_session_application.cpp
index 0d1f6ac140a..44251fa39dc 100644
--- a/src/mongo/db/s/resharding/resharding_oplog_session_application.cpp
+++ b/src/mongo/db/s/resharding/resharding_oplog_session_application.cpp
@@ -110,8 +110,9 @@ boost::optional<SharedSemiFuture<void>> ReshardingOplogSessionApplication::tryAp
auto lsid = *op.getSessionId();
if (isInternalSessionForNonRetryableWrite(lsid)) {
- // TODO (SERVER-63877): Determine if resharding should migrate internal sessions for
- // non-retryable writes.
+ // Skip internal sessions for non-retryable writes since they only support transactions
+ // and those transactions are not retryable so there is no need to transfer the write
+ // history to resharding recipient(s).
return boost::none;
}
if (isInternalSessionForRetryableWrite(lsid)) {
diff --git a/src/mongo/db/s/resharding/resharding_oplog_session_application_test.cpp b/src/mongo/db/s/resharding/resharding_oplog_session_application_test.cpp
index 7a5cb0f214e..dfaa498e4f6 100644
--- a/src/mongo/db/s/resharding/resharding_oplog_session_application_test.cpp
+++ b/src/mongo/db/s/resharding/resharding_oplog_session_application_test.cpp
@@ -1134,8 +1134,6 @@ TEST_F(ReshardingOplogSessionApplicationTest, IgnoreIncomingAbortedRetryableInte
}
TEST_F(ReshardingOplogSessionApplicationTest, IgnoreIncomingNonRetryableInternalTransaction) {
- // TODO (SERVER-63877): Determine if resharding should migrate internal sessions for
- // non-retryable writes.
auto lsid = makeLogicalSessionIdWithTxnUUIDForTest();
TxnNumber incomingTxnNumber = 100;
diff --git a/src/mongo/db/s/resharding/resharding_txn_cloner.cpp b/src/mongo/db/s/resharding/resharding_txn_cloner.cpp
index a6d9836a334..0423118038a 100644
--- a/src/mongo/db/s/resharding/resharding_txn_cloner.cpp
+++ b/src/mongo/db/s/resharding/resharding_txn_cloner.cpp
@@ -171,8 +171,9 @@ boost::optional<SharedSemiFuture<void>> ReshardingTxnCloner::doOneRecord(
auto txnNumber = donorRecord.getTxnNum();
if (isInternalSessionForNonRetryableWrite(sessionId)) {
- // TODO (SERVER-63877): Determine if resharding should migrate internal sessions for
- // non-retryable writes.
+ // Skip internal sessions for non-retryable writes since they only support transactions
+ // and those transactions are not retryable so there is no need to transfer the write
+ // history to resharding recipient(s).
return boost::none;
}