-
Notifications
You must be signed in to change notification settings - Fork 601
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
datalake/coordinator: initial coordinator base #23712
Conversation
eb54b88
to
2115f9d
Compare
This will be useful for logging.
2115f9d
to
7637549
Compare
Pulls some utilities out of a test to make it easier to reuse building state updates.
For use by the upcoming datalake coordinator STM to track files that need to be committed to Iceberg.
Adds topics_state to the STM, and updates the apply method to appropriately update it.
7637549
to
7ae61d7
Compare
} | ||
return update; | ||
} | ||
|
||
bool add_files_update::can_apply(const topics_state& state) { | ||
checked<std::nullopt_t, stm_update_error> |
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: would be be useful to define a "no error state" in stm_update_error
enum class stm_update_error {
none
failed,
};
that I think removes the need for check<nullopt_t...>
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've been preferring to use errors for only error types, and use result/checked to signal expected vs not expected outcomes. I kind of like how error handling is uniform now with has_error()
, instead of having to guess about optionality or special 0 codes
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.
hmm ok, fwiw https://en.cppreference.com/w/cpp/error/error_code/operator_bool also defines using a none
equivalent with 0 value, so thats somewhat of a standard approach I guess, anyway I'm not too strong about it.
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.
Yea, IMO C++'s "best practices" for error handling are a bit error prone, unless we standardize our codebase to One True Way, it's way too easy to mess up..
"Rejecting request to add files for {}: {}", | ||
tp, | ||
update_res.error()); | ||
co_return errc::stm_apply_error; |
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: I think this is a validation error? (since its pre replication).
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.
From the caller's perspective they should be the same thing, no? the request does not apply cleanly to the stm
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 was thinking from a debugging perspective, if the request was rejected due to a race or if was legit validation, nbd, feel free to keep it as is.
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.
Leaving it for now, i think the log is enough, unless these get serialized in the response and the only logs we have are the worker logs
46340ac
to
89e151f
Compare
In some upcoming changes, we'll expect the STM to be an implementation detail, and for callers to go through a separate coordinator abstraction. To that end, this moves most STM methods out of the public interface and exposes some internals for use in the upcoming coordinator.
Adds some initial structure for the coordinator. This commit just adds wrapper around a couple of calls to the underlying STM, so that it can be plugged into the frontend. Later commits will have the coordinator reconcile the STM with the Iceberg catalog, perform local/Raft snapshots, etc.
89e151f
to
9ca5fac
Compare
ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/56296#019277d5-c406-497a-9b65-c731729932af |
Retry command for Build#56296please wait until all jobs are finished before running the slash command
|
} | ||
|
||
checked<ss::gate::holder, coordinator::errc> coordinator::maybe_gate() { | ||
ss::gate::holder h; |
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.
h
is unused? intentional?
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.
Oops! unintentional, may fix in a follow up if this PR can get merged
Based on #23714
Backports Required
Release Notes