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

c/node_status_backend: fix handling members notification #11468

Merged
merged 2 commits into from
Jun 16, 2023

Conversation

ztlpn
Copy link
Contributor

@ztlpn ztlpn commented Jun 15, 2023

If the members table update is coming from a controller snapshot, and the node is already being decommissioned, there won't be a notification with status "added", only with status "draining". Node discovery code should handle this case as well.

(partially) fixes #9052

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

Release Notes

  • none

If the members table update is coming from a controller snapshot, and
the node is already being decommissioned, there won't be a notification
with status "added", only with status "draining". Node discovery code
should handle this case as well.
@@ -93,7 +93,9 @@ ss::future<> node_status_backend::drain_notifications_queue() {

ss::future<> node_status_backend::handle_members_updated_notification(
model::node_id node_id, model::membership_state state) {
if (state == model::membership_state::active) {
switch (state) {
case model::membership_state::active:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks fine but I thought you mentioned something about issuing notifications differently when loading from a snapshot (thats probably going to be a little more complicated than this patch) but just wanted to check..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a bit of a subtlety with semantics of these notifications - previously they looked like "here is a node id, something happened to it", which is bit lacking, but robust. Recently, state information was added to them so the clients of these notifications may think that they would allow tracing all the history of changes - which is obviously impossible with snapshots. So the clients should deal with the fact that the won't see some state changes.

But I guess generating at least an "added" notification won't hurt - we can make it more robust both on the client and the generation side.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I thought for a while and decided to keep the current members_table behavior. This is essentially a difference between edge-triggered and level-triggered events and I think it is better to stick to one or another (level-triggered in this case). Added a clarifying comment to members_table.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, that makes sense.

@ztlpn ztlpn requested a review from bharathv June 16, 2023 12:21
@mmaslankaprv mmaslankaprv merged commit c4465c3 into redpanda-data:dev Jun 16, 2023
@ztlpn ztlpn deleted the fix-node-status-be-mt-notif branch November 27, 2023 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants