You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2022/11/11 12:01:22 UTC
[GitHub] [ignite-3] sanpwc commented on a diff in pull request #1332: IGNITE-18125 Fix NullPointerException in InternalTableImpl#enlist()
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org