Skip to content

Commit

Permalink
Merge pull request #14886 from vbotbuildovich/backport-pr-14822-v23.2…
Browse files Browse the repository at this point in the history
….x-512

[v23.2.x] fixed rendering transaction status
  • Loading branch information
piyushredpanda committed Nov 14, 2023
2 parents a83ff57 + 750aa5b commit d60b3d0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/v/kafka/server/server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1603,7 +1603,7 @@ list_transactions_handler::handle(request_context ctx, ss::smp_service_group) {
list_transaction_state tx_state;
tx_state.transactional_id = tx.id;
tx_state.producer_id = kafka::producer_id(tx.pid.id);
tx_state.transaction_state = ss::sstring(tx.get_status());
tx_state.transaction_state = ss::sstring(tx.get_kafka_status());
response.data.transaction_states.push_back(std::move(tx_state));
}
}
Expand Down
11 changes: 7 additions & 4 deletions tests/rptest/tests/transaction_kafka_api_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,10 @@ def test_list_transactions(self):

txs_info = self.kafka_cli.list_transactions()
assert len(txs_info) > 0
for tx in txs_info:
tx_info = self.kafka_cli.describe_transaction(
tx["TransactionalId"])
assert int(tx_info["ProducerId"]) == int(tx["ProducerId"])
for tx_from_list in txs_info:
tx_from_describe = self.kafka_cli.describe_transaction(
tx_from_list["TransactionalId"])

for f in ["TransactionalId", "TransactionState", "ProducerId"]:
assert tx_from_describe[f] == tx_from_list[f]
assert tx_from_list["TransactionState"] != "Unknown"

0 comments on commit d60b3d0

Please sign in to comment.