-
Notifications
You must be signed in to change notification settings - Fork 552
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
Shard producer state manager with v_cluster_id
#16992
Shard producer state manager with v_cluster_id
#16992
Conversation
4e4412d
to
ce29dea
Compare
new failures in https://buildkite.com/redpanda/redpanda/builds/46046#018e3236-bc93-42f2-8f65-14656265c541:
new failures in https://buildkite.com/redpanda/redpanda/builds/46614#018e6653-d8b7-462b-88a8-e1af5b154ae7:
|
ce29dea
to
7f376dd
Compare
ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/46264#018e42ef-8a29-4ac7-bea9-3e312dbca478 ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/46614#018e6653-d8b2-461c-9c45-79487c5e56b6 ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/46721#018e7723-5907-457d-bbe4-aaf24924ab55 ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/46721#018e7737-0973-4bbd-8128-4b4cb93014e4 ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/46875#018e801c-4769-434c-a195-35aacbef34c8 ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/46894#018e80a6-6ee7-4a7e-abbe-238fc4e39ff3 ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/46894#018e80b8-ae52-4923-9cfb-52a570454cb8 |
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.
lgtm overall, mostly minor comments.
@@ -223,38 +219,24 @@ class producer_state { | |||
void update_current_txn_start_offset(std::optional<kafka::offset> offset) { | |||
_current_txn_start_offset = offset; | |||
} | |||
safe_intrusive_list_hook _hook; |
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.
why is this public? seems a bit risky, perhaps befriend the other class?
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.
it is a common pattern across the source to have the hook public, i will try in a follow up to change this.
}); | ||
}); | ||
if (_evicted) { | ||
throw ss::gate_closed_exception(); |
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.
nit: gate_closed_exception without a gate instance seems a bit confusing.
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.
yeah, agreed. I wanted to be consistent with previous behavior where a gate was part of the producer_state
. Producer eviction was signalled by gate_closed_exception
src/v/config/configuration.cc
Outdated
, virtual_cluster_min_producer_ids( | ||
*this, | ||
"virtual_cluster_min_producer_ids", | ||
"Minium number of active producers per virtual cluster", |
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: minimum
A little more color might be helpful. Why a minimum is needed.
Also on naming, should we prefix all mpx stuff with "mpx_", mpx_min_producers_per_cluder_id or something?
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.
i didn't want the mpx_
prefix to be epidemic
7f376dd
to
6a40f42
Compare
66f34b7
to
94db988
Compare
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.
lgtm.
94db988
to
1b6f59d
Compare
1b6f59d
to
c45d879
Compare
Producer state manager is a cluster module service Raft layer should not depend on any cluster related services. Signed-off-by: Michal Maslanka <michal@redpanda.com>
Added time based eviction driven by an external timer to the `cluster::namespaced_cache` the method allows to evict entries older than the requested time. Signed-off-by: Michal Maslanka <michal@redpanda.com>
Using namespaced cache to isolate producer id queues for each virtual cluster. Each virtual cluster has its own guaranteed number of producer ids. If not all producer id slots are used virtual clusters will use more than minimum number of producer ids until they are required to provide min number of producer ids for other virtual clusters. Signed-off-by: Michal Maslanka <michal@redpanda.com>
Signed-off-by: Michal Maslanka <michal@redpanda.com>
Passing partition virtual cluster id to rm_stm to be able to add a virtual cluster context to producer state that is managed in producer state manager. Signed-off-by: Michal Maslanka <michal@redpanda.com>
Made producer state manager configurable with minimal number of producers per virtual cluster. Signed-off-by: Michal Maslanka <michal@redpanda.com>
Signed-off-by: Michal Maslanka <michal@redpanda.com>
When the number of allowed virtual clusters maintained in producer state manager cache is exceeded a cache throws an exception. The exception is translated to the error code indicating that the cache size limit was exceeded. The error code is finally translated to kafka policy violation error. This error is not retryable and will indicate issue with number of producers. Signed-off-by: Michal Maslanka <michal@redpanda.com>
Signed-off-by: Michal Maslanka <michal@redpanda.com>
c45d879
to
0ba1d36
Compare
Change implementation of
producer_state_manager
to keep separate producer state LRU cache for eachv_cluster_id.
This approach isolates each virtual cluster queue and guarantees fair distribution of producer state slots among them.Backports Required
Release Notes