keith-turner commented on code in PR #4160:
URL: https://github.com/apache/accumulo/pull/4160#discussion_r1451606732
##########
core/src/main/java/org/apache/accumulo/core/fate/accumulo/FateMutatorImpl.java:
##########
@@ -105,13 +108,20 @@ public FateMutator<T> putTxInfo(TxInfo txInfo, byte[]
data) {
case RETURN_VALUE:
putReturnValue(data);
break;
+ default:
+ throw new IllegalArgumentException("Unexpected TxInfo type " + txInfo);
}
return this;
}
@Override
public FateMutator<T> putRepo(int position, Repo<T> repo) {
- mutation.put(RepoColumnFamily.NAME, invertRepo(position), new
Value(serialize(repo)));
+ final Text cq = invertRepo(position);
+ // ensure this repo is not already set
+ mutation.addCondition(new Condition(RepoColumnFamily.NAME, cq));
Review Comment:
We could add a stronger check that ensure the current max repo in storage is
`position - 1`. This could be done with a specialized iterator. Or could have
to conditions like :
* A condition that checks `position` is absent
* A condition that checks that `position -1` is present.
--
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]