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

[v23.2.x] Simplified mapping transaction id to coordinator partition #15345

Merged
merged 31 commits into from
Dec 7, 2023

Conversation

mmaslankaprv
Copy link
Member

@mmaslankaprv mmaslankaprv commented Dec 6, 2023

Backport of PR #14882
Backport of PR #13146
Backport of PR #11021

Fixes: #15137

@mmaslankaprv mmaslankaprv force-pushed the v23.2.x-migration branch 3 times, most recently from d735f3e to e7e75d3 Compare December 6, 2023 20:49
rystsov and others added 26 commits December 7, 2023 09:21
Intoducing tx_registry_stm a tx registry service will be based on.
tx_registry_stm is modeled after is_allocator_stm and doesn't rely
on cleanup policy to control the size of the log. Instead the stm
does prefix truncation on its own then the size of the log passes
_log_capacity batches.

(cherry picked from commit 53c8f56)
try_init_hosted_transactions check if hosted transactions are initialized
and if they don't try_init_hosted_transactions takes the write lock and
initilized the transactions.

However while the method waits for the write lock the state may change so
to avoid hosted txs from being initialized twice it's necessary to check
the state again after the lock is taken.

(cherry picked from commit 39f2ec1)
Removing `tm_` prefix because the types overgrown transaction
manager (coordinator) and will be reused within tx registry

(cherry picked from commit c48eba4)
(cherry picked from commit 0470b04)
(cherry picked from commit ac36670)
kafka protocol doesn't require a broker to forward init_tm_tx
to a leader and expects that it's a client responsibility to
find who's the leader

Fixes redpanda-data#6418

(cherry picked from commit 7bc98c9)
Signed-off-by: Michal Maslanka <michal@redpanda.com>
(cherry picked from commit eb3b5e0)
Implemented simple static assignment of transaction id (application
identifier) to `kafka_internal/tx` topic partition. The mapping is based
on a simple mechanism where the whole transactional id hash range is equally
divided between all the transaction coordinator partitions.
The new transaction id assignment is compatible with previous default
partition hash ranges assignment therefore there is no backward
compatibility issues. The new mechanism makes finding transaction
coordinator easy and straightforward.

Signed-off-by: Michal Maslanka <michal@redpanda.com>
(cherry picked from commit a45162a)
Added test that verifies if new simplified transactional coordinator
lookup logic is compatible with previous one.

Signed-off-by: Michal Maslanka <michal@redpanda.com>
(cherry picked from commit 4118290)
Removed tx_registry class as it is no longer used

Signed-off-by: Michal Maslanka <michal@redpanda.com>
(cherry picked from commit 5003e9c)
Signed-off-by: Michal Maslanka <michal@redpanda.com>
(cherry picked from commit 20242bd)
Signed-off-by: Michal Maslanka <michal@redpanda.com>
(cherry picked from commit b4c8cd3)
Signed-off-by: Michal Maslanka <michal@redpanda.com>
(cherry picked from commit 457aebb)
mmaslankaprv and others added 5 commits December 7, 2023 09:21
When waiting for topic to be created `controller_api` should include
waiting for topic metadata.

Signed-off-by: Michal Maslanka <michal@redpanda.com>
(cherry picked from commit 9a23798)
Signed-off-by: Michal Maslanka <michal@redpanda.com>
(cherry picked from commit 7bb5c56)
Several tests set configs directly with config::shard_local_config
without cleaning them up after. This means that the next test that gets
run in the same process may be affected by whatever a previous test had
set.

This introduces a new scoped wrapper around config::shard_local_config
to track what properties may have been updated, so it may reset them
upon call to destructor.

(cherry picked from commit ed4d72d)
Uses the new scoped_config to reset updated configs to their
defaults at the end of each test. This ensures no side effects across
tests.

(cherry picked from commit d15a801)
Signed-off-by: Michal Maslanka <michal@redpadna.com>
@CLAassistant
Copy link

CLAassistant commented Dec 7, 2023

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
3 out of 4 committers have signed the CLA.

✅ rystsov
✅ mmaslankaprv
✅ andrwng
❌ Michal Maslanka


Michal Maslanka seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@mmaslankaprv mmaslankaprv added this to the v23.2.18 milestone Dec 7, 2023
@mmaslankaprv
Copy link
Member Author

ci failure: #15295

@mmaslankaprv
Copy link
Member Author

the golang issue is independent from this PR: #15364

@mmaslankaprv mmaslankaprv merged commit 07d4990 into redpanda-data:v23.2.x Dec 7, 2023
22 of 26 checks passed
@mmaslankaprv mmaslankaprv deleted the v23.2.x-migration branch December 7, 2023 17:15
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.

5 participants