sanpwc commented on code in PR #1332:
URL: https://github.com/apache/ignite-3/pull/1332#discussion_r1020157465
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/storage/InternalTableImpl.java:
##########
@@ -1124,7 +1124,10 @@ protected CompletableFuture<IgniteBiTuple<ClusterNode,
Long>> enlist(int partId,
// TODO asch IGNITE-15091 fixme need to map to the same leaseholder.
// TODO asch a leader race is possible when enlisting different keys
from the same partition.
return fut0.handle((primaryPeerAndTerm, e) -> {
- if (primaryPeerAndTerm.get1() == null || e != null) {
+ if (e != null) {
+ throw new TransactionException("Failed to get the primary
replica.", e);
Review Comment:
I would rather use withCause with REPLICA_UNAVAILABLE_ERR code here.
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/storage/InternalTableImpl.java:
##########
@@ -1124,7 +1124,10 @@ protected CompletableFuture<IgniteBiTuple<ClusterNode,
Long>> enlist(int partId,
// TODO asch IGNITE-15091 fixme need to map to the same leaseholder.
// TODO asch a leader race is possible when enlisting different keys
from the same partition.
return fut0.handle((primaryPeerAndTerm, e) -> {
- if (primaryPeerAndTerm.get1() == null || e != null) {
+ if (e != null) {
Review Comment:
I think you can just swap primaryPeerAndTerm.get1() == null and e != null.
--
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]