MINOR: RegisterBroker should use an atomic append (#11700)

The batch of records that registers a new broker should be committed atomically. This doesn't matter
right now, because we only create a single record to register the broker. But if we create multiple
records in the future, this could matter. In order to avoid confusion, this should use
ControllerResult#atomicOf.

Reviewers: David Arthur <mumrah@gmail.com>
This commit is contained in:
Colin Patrick McCabe 2022-01-21 10:09:11 -08:00 committed by GitHub
parent 448e44a734
commit 486cbd4793
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -252,7 +252,7 @@ public class ClusterControlManager {
List<ApiMessageAndVersion> records = new ArrayList<>(); List<ApiMessageAndVersion> records = new ArrayList<>();
records.add(new ApiMessageAndVersion(record, records.add(new ApiMessageAndVersion(record,
REGISTER_BROKER_RECORD.highestSupportedVersion())); REGISTER_BROKER_RECORD.highestSupportedVersion()));
return ControllerResult.of(records, new BrokerRegistrationReply(brokerEpoch)); return ControllerResult.atomicOf(records, new BrokerRegistrationReply(brokerEpoch));
} }
public void replay(RegisterBrokerRecord record) { public void replay(RegisterBrokerRecord record) {