Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

txns: fix list txns failure when it's used before find_coordinator #12116

Merged
merged 1 commit into from
Aug 3, 2023

Conversation

rystsov
Copy link
Contributor

@rystsov rystsov commented Jul 14, 2023

find_coordinator creates txn coordinator's topic when it's used for the first time. list_transactions api expects the topic to be already created so it used to fail when the api was invoked before find_coordinator. Fixed the problem by creating the topic on the first list txns call too.

Fixes #11947

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v23.1.x
  • v23.2.x
  • v22.3.x
  • v22.2.x

Release Notes

  • none

mmaslankaprv
mmaslankaprv previously approved these changes Jul 20, 2023
find_coordinator creates txn coordinator's topic when it's used for
the first time. list txns api expects the topic to be already created
so it used to fail when the api was invoked before find_coordinator.
Fixed the problem by creating the topic on the first list txns call.

fixes redpanda-data#11947
Copy link
Contributor

@bharathv bharathv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, just a couple of clarifications.

src/v/cluster/tx_registry_frontend.cc Show resolved Hide resolved
@@ -316,7 +351,8 @@ ss::future<bool> tx_registry_frontend::try_create_tx_topic() {
return _controller->get_topics_frontend()
.local()
.autocreate_topics(
{std::move(topic)}, config::shard_local_cfg().create_topic_timeout_ms())
{std::move(topic)},
config::shard_local_cfg().create_topic_timeout_ms() * partitions_amount)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

q: whats the rationale behind * partitions_amount part?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create_topic_timeout_ms is too small to create 50 partitions in the ci environment. before it was use to create a single partition, * partitions_amount is the proportional increase. it's a bit meh but imho good enough, at least for the fix.

@rystsov rystsov requested a review from bharathv August 2, 2023 14:50
@rystsov rystsov merged commit ad733f5 into redpanda-data:dev Aug 3, 2023
@vbotbuildovich
Copy link
Collaborator

/backport v23.1.x

@vbotbuildovich
Copy link
Collaborator

Failed to run cherry-pick command. I executed the commands below:

git checkout -b backport-pr-12116-v23.1.x-763 remotes/upstream/v23.1.x
git cherry-pick -x 85ad993098860d37cd80dc6d9400aff134b2ae16

Workflow run logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ListTransactions does not work until a transaction has been used
4 participants