-
Notifications
You must be signed in to change notification settings - Fork 594
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
tx/group compaction fixes #24637
Open
bharathv
wants to merge
12
commits into
redpanda-data:dev
Choose a base branch
from
bharathv:fix_co
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,575
−81
Open
tx/group compaction fixes #24637
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
03c425e
tx/group: track begin offset of transactions
bharathv 5e8358a
tx/group: support describe_producers for group
bharathv 00df369
tx/tests/dt: test for describe producers
bharathv b80c4d9
group/stm: additional trace logging
bharathv e247e1f
tx/groups: escape hatch for unsafe aborting of group transactions
bharathv 1db8d69
tx/group/compaction: ignore tx_fence batches
bharathv 4f292ff
k/group: disallow group deletion while transactions in progress
bharathv 15a0d0a
group/tx: add a ducktape test for compactibility of consumer_offsets
bharathv 796ac17
tx/producer_state: add getters for internal state
bharathv c1c904d
tx/observability: add types and plumbing needed to get producer states
bharathv e5b9b46
tx/admin: types for exposing producer info in REST api
bharathv 10ea2db
tx/observability: REST endpoint to fetch all producers from a partition
bharathv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2974,4 +2974,86 @@ ss::future<tx::errc> tx_gateway_frontend::do_delete_partition_from_tx( | |
co_return tx::errc::none; | ||
} | ||
|
||
ss::future<tx::errc> tx_gateway_frontend::unsafe_abort_group_transaction( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you add a comment describing what is "unsafe" about this operation? what invariants will break? what semantic behavior breaks? |
||
kafka::group_id group, | ||
model::producer_identity pid, | ||
model::tx_seq tx_seq, | ||
model::timeout_clock::duration timeout) { | ||
auto holder = _gate.hold(); | ||
vlog( | ||
txlog.warn, | ||
"Issuing an unsafe abort of group transaction, group: {}, pid: {}, seq: " | ||
"{}, timeout: {}", | ||
group, | ||
pid, | ||
tx_seq, | ||
timeout); | ||
auto result = co_await _rm_group_proxy->abort_group_tx( | ||
std::move(group), pid, tx_seq, timeout); | ||
co_return result.ec; | ||
} | ||
|
||
ss::future<get_producers_reply> | ||
tx_gateway_frontend::get_producers(get_producers_request request) { | ||
auto holder = _gate.hold(); | ||
const auto& ntp = request.ntp; | ||
if (!_metadata_cache.local().contains(ntp)) { | ||
co_return get_producers_reply{ | ||
.error_code = tx::errc::partition_not_exists}; | ||
} | ||
|
||
auto leader_opt = _leaders.local().get_leader(ntp); | ||
if (!leader_opt) { | ||
co_return get_producers_reply{.error_code = tx::errc::leader_not_found}; | ||
} | ||
auto leader = leader_opt.value(); | ||
if (leader == _self) { | ||
auto shard = _shard_table.local().shard_for(ntp); | ||
if (!shard.has_value()) { | ||
co_return get_producers_reply{ | ||
.error_code = tx::errc::shard_not_found}; | ||
} | ||
co_return co_await container().invoke_on( | ||
shard.value(), | ||
_ssg, | ||
[request = std::move(request)](tx_gateway_frontend& local) mutable { | ||
return local.get_producers_locally(std::move(request)); | ||
}); | ||
} | ||
auto timeout = request.timeout; | ||
auto result = co_await _connection_cache.local() | ||
.with_node_client<tx_gateway_client_protocol>( | ||
_self, | ||
ss::this_shard_id(), | ||
leader, | ||
model::timeout_clock::now() + timeout, | ||
[request = std::move(request), | ||
timeout](tx_gateway_client_protocol cp) mutable { | ||
return cp.get_producers( | ||
std::move(request), | ||
rpc::client_opts( | ||
model::timeout_clock::now() + timeout)); | ||
}); | ||
if (result.has_error()) { | ||
co_return get_producers_reply{.error_code = tx::errc::not_coordinator}; | ||
} | ||
co_return std::move(result.value().data); | ||
} | ||
|
||
ss::future<get_producers_reply> | ||
tx_gateway_frontend::get_producers_locally(get_producers_request request) { | ||
auto& ntp = request.ntp; | ||
bool is_consumer_offsets_ntp = ntp.ns() | ||
== model::kafka_consumer_offsets_nt.ns() | ||
&& ntp.tp.topic | ||
== model::kafka_consumer_offsets_nt.tp; | ||
|
||
if (is_consumer_offsets_ntp) { | ||
co_return co_await _rm_group_proxy->get_group_producers_locally( | ||
std::move(request)); | ||
} | ||
co_return co_await _rm_partition_frontend.local().get_producers_locally( | ||
std::move(request)); | ||
} | ||
|
||
} // namespace cluster |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: fnished -> finished