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

Remove RESTARTED/RECONFIGURED state #11

Open
wants to merge 1 commit into
base: rackrolling-update
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,6 @@ State transitionTo(State state, Time time) {
return state;
}
this.state = state;
if (state == State.RESTARTED) {
this.numRestarts++;
}
if (state == State.RECONFIGURED) {
this.numReconfigs++;
}
this.lastTransition = time.systemTimeMillis();
return state;
}
Expand Down Expand Up @@ -106,6 +100,14 @@ public int numAttempts() {
return numAttempts;
}

public void incrementNumRestarts() {
this.numRestarts++;
}

public void incrementNumReconfigs() {
this.numReconfigs++;
}

public void incrementNumAttempts() {
this.numAttempts++;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,8 @@ private static void restartNode(Reconciliation reconciliation,
} catch (RuntimeException e) {
LOGGER.warnCr(reconciliation, "An exception thrown during the restart of the node {}", context.nodeRef(), e);
}
context.transitionTo(State.RESTARTED, time);
context.transitionTo(State.UNKNOWN, time);
context.incrementNumRestarts();
LOGGER.debugCr(reconciliation, "Node {}: Restarted", context.nodeRef());
}

Expand All @@ -295,7 +296,8 @@ private static void reconfigureNode(Reconciliation reconciliation,
}
LOGGER.debugCr(reconciliation, "Node {}: Reconfiguring", context.nodeRef());
rollClient.reconfigureNode(context.nodeRef(), context.brokerConfigDiff(), context.loggingDiff());
context.transitionTo(State.RECONFIGURED, time);
context.transitionTo(State.UNKNOWN, time);
context.incrementNumReconfigs();
LOGGER.debugCr(reconciliation, "Node {}: Reconfigured", context.nodeRef());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@
* Enumerates the possible "rolling states" of a Kafka node
*/
enum State {
UNKNOWN, // the initial state
UNKNOWN, // the initial state or the node is successfully restarted/reconfigured
NOT_RUNNING, // The pod/process is not running.
NOT_READY, // decided to restart right now or broker state < 2 OR == 127
RESTARTED, // after successful kube pod delete
RECONFIGURED, // after successful reconfig
RECOVERING, // broker state == 2
SERVING, // broker state >= 3 AND != 127
LEADING_ALL_PREFERRED // broker state== 3 and leading all preferred replicas
Expand Down