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

[v24.1.x] producer_state: add request::set_error and make it idempotent #21524

Merged
merged 3 commits into from
Jul 22, 2024

Conversation

bharathv
Copy link
Contributor

A request can be marked as errored multiple times, consider the example
below.

replicate_f : waiting for replication
term change and leadership change
requests from old terms gc-ed: set_err(ec) -- separate fiber
replicate_f: set_err(ec)

Current assert assumes that a request can be set only once, which is
true for setting a successful result but not for errors. This commit
splits set_value() into set_value() and set_error() and adjusts
assert conditions accordingly.

This was identified in a chaos build. Also included some logging improvements noticed while debugging, most notably printing the transaction state correctly (currently printing the pointer instead of value).

Fixes: #19841

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
  • v24.1.x
  • v23.3.x
  • v23.2.x

Release Notes

  • none

bharathv added 3 commits July 19, 2024 08:22
these are supposed to be rare and typically indicate a misbehaving
broker or client.

(cherry picked from commit 7579cf1)
A request can be marked as errored multiple times, consider the example
below.

replicate_f : waiting for replication
term change
requests from old terms gc-ed: set_err(ec)
replicate_f: set_err(ec)

Current assert assumes that a request can be set only once, which is
true for setting a successful result but not for errors. This commit
splits set_value() into set_value() and set_error() and adjusts
assert conditions accordingly.

(cherry picked from commit 7719140)
@bharathv
Copy link
Contributor Author

Failures: #19789
#16090

@piyushredpanda piyushredpanda added this to the v24.1.x-next milestone Jul 21, 2024
@piyushredpanda piyushredpanda merged commit b2246ae into redpanda-data:v24.1.x Jul 22, 2024
14 of 18 checks passed
@piyushredpanda piyushredpanda modified the milestones: v24.1.x-next, v24.1.12 Jul 22, 2024
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.

4 participants