kevinrr888 commented on code in PR #4524:
URL: https://github.com/apache/accumulo/pull/4524#discussion_r1700585082
##########
core/src/main/java/org/apache/accumulo/core/fate/MetaFateStore.java:
##########
@@ -224,9 +322,20 @@ public void setStatus(TStatus status) {
verifyReserved(true);
try {
- zk.putPersistentData(getTXPath(fateId), new
NodeValue(status).serialize(),
- NodeExistsPolicy.OVERWRITE);
- } catch (KeeperException | InterruptedException e) {
+ zk.mutateExisting(getTXPath(fateId), currSerializedData -> {
+ NodeValue currNodeVal = new NodeValue(currSerializedData);
+ // Ensure the FateId is reserved in ZK, and it is reserved with the
expected reservation
+ if (currNodeVal.isReservedBy(this.reservation)) {
+ FateReservation currFateReservation =
currNodeVal.reservation.orElseThrow();
+ FateKey currFateKey = currNodeVal.fateKey.orElse(null);
+ NodeValue newNodeValue = new NodeValue(status,
currFateReservation, currFateKey);
+ return newNodeValue.serialize();
+ } else {
+ throw new IllegalStateException("Either the FateId is not reserved
in ZK, or it is"
Review Comment:
Yes, I must have forgotten it here. Added and included the reservation in
the log as well. Double checked AFS, UFS, and MFS that everywhere something is
logged or thrown regarding a fate id that the fate id is included in the
message, so no follow on issue needed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]