Skip to content
Merged
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 @@ -1181,10 +1181,6 @@ private void claim(int epoch) {
new CompleteActivationEvent(),
EnumSet.of(DOES_NOT_UPDATE_QUEUE_TIME, RUNS_IN_PREMIGRATION)
);
activationEvent.future.exceptionally(t -> {
fatalFaultHandler.handleFault("exception while activating controller", t);
return null;
});
queue.prepend(activationEvent);
} catch (Throwable e) {
fatalFaultHandler.handleFault("exception while claiming leadership", e);
Expand Down Expand Up @@ -1275,12 +1271,21 @@ public static List<ApiMessageAndVersion> generateActivationRecords(
}
return records;
}

class CompleteActivationEvent implements ControllerWriteOperation<Void> {
@Override
public ControllerResult<Void> generateRecordsAndResult() {
List<ApiMessageAndVersion> records = generateActivationRecords(log, logReplayTracker.empty(),
zkMigrationEnabled, bootstrapMetadata, featureControl);
return ControllerResult.atomicOf(records, null);
try {
List<ApiMessageAndVersion> records = generateActivationRecords(log,
logReplayTracker.empty(),
zkMigrationEnabled,
bootstrapMetadata,
featureControl);
return ControllerResult.atomicOf(records, null);
} catch (Throwable t) {
throw fatalFaultHandler.handleFault("exception while completing controller " +

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think in most other places, we are not inside an event when we call the fault handler in QuorumController. I guess that doesn't matter since it calls Exit.halt synchronously?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, it's OK to halt from an event (or more generally to invoke fault handlers from that context)

"activation", t);
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1359,7 +1359,7 @@ public void testBootstrapZkMigrationRecord() throws Exception {
assertEquals(
"The bootstrap metadata.version 3.3-IV0 does not support ZK migrations. Cannot continue with ZK migrations enabled.",
assertThrows(FaultHandlerException.class, () ->
checkBootstrapZkMigrationRecord(MetadataVersion.IBP_3_3_IV0, true)).getCause().getCause().getMessage()
checkBootstrapZkMigrationRecord(MetadataVersion.IBP_3_3_IV0, true)).getCause().getMessage()
);
}

Expand Down