From 1cd04b8fd8fd33d51c959f23eed5455864648de5 Mon Sep 17 00:00:00 2001 From: Siddharth Shah Date: Wed, 18 Dec 2024 12:24:01 +0530 Subject: [PATCH] [#25351] CDC: Remove dead code checking txn status in CDC Summary: There was dead code in cdc producer where we were checking the transaction status of a multi-shard transaction but not really using the result. This is being removed in the diff. Jira: DB-14567 Test Plan: Jenkins: test regex: .*CDC* Reviewers: sumukh.phalgaonkar Reviewed By: sumukh.phalgaonkar Subscribers: svc_phabricator, ycdcxcluster Tags: #jenkins-ready Differential Revision: https://phorge.dev.yugabyte.com/D40745 --- src/yb/cdc/cdcsdk_producer.cc | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/yb/cdc/cdcsdk_producer.cc b/src/yb/cdc/cdcsdk_producer.cc index a103d9fb16d9..576ca9bdd9ea 100644 --- a/src/yb/cdc/cdcsdk_producer.cc +++ b/src/yb/cdc/cdcsdk_producer.cc @@ -115,24 +115,6 @@ using dockv::SchemaPackingStorage; namespace { YB_DEFINE_ENUM(OpType, (INSERT)(UPDATE)(DELETE)); -Result GetTransactionStatus( - const TransactionId& txn_id, - const HybridTime& hybrid_time, - tablet::TransactionParticipant* txn_participant) { - static const std::string reason = "cdc"; - - std::promise> txn_status_promise; - auto future = txn_status_promise.get_future(); - auto callback = [&txn_status_promise](Result result) { - txn_status_promise.set_value(std::move(result)); - }; - - txn_participant->RequestStatusAt( - {&txn_id, hybrid_time, hybrid_time, 0, &reason, TransactionLoadFlags{}, callback}); - future.wait(); - return future.get(); -} - void SetOperation(RowMessage* row_message, OpType type, const Schema& schema) { switch (type) { case OpType::INSERT: @@ -2757,7 +2739,6 @@ Status GetChangesForCDCSDK( break; } - auto txn_participant = tablet_ptr->transaction_participant(); have_more_messages = HaveMoreMessages(true); Schema current_schema = *tablet_ptr->metadata()->schema(); @@ -2842,7 +2823,6 @@ Status GetChangesForCDCSDK( if (msg->transaction_state().status() == TransactionStatus::APPLYING) { auto txn_id = VERIFY_RESULT( FullyDecodeTransactionId(msg->transaction_state().transaction_id())); - auto result = GetTransactionStatus(txn_id, tablet_peer->Now(), txn_participant); // It is possible for a transaction to have two APPLYs in WAL. This check // prevents us from streaming the same transaction twice in the same GetChanges