sanpwc commented on code in PR #2694:
URL: https://github.com/apache/ignite-3/pull/2694#discussion_r1361265739
##########
modules/table/src/integrationTest/java/org/apache/ignite/distributed/ItTxDistributedTestSingleNode.java:
##########
@@ -178,14 +178,13 @@ protected TxManager clientTxManager() {
/** {@inheritDoc} */
@Override
- protected TxManager txManager(Table t) {
- var clients = txTestCluster.raftClients.get(t.name());
+ protected TxManager txManager(TableImpl t) {
- Peer leader = clients.get(0).leader();
+ CompletableFuture<ReplicaMeta> primaryReplica =
txTestCluster.placementDriver.getPrimaryReplica(
+ new TablePartitionId(t.tableId(), 0),
+ txTestCluster.clocks.get(txTestCluster.localNodeName).now());
- assertNotNull(leader);
-
- TxManager manager =
txTestCluster.txManagers.get(leader.consistentId());
+ TxManager manager =
txTestCluster.txManagers.get(primaryReplica.join().getLeaseholder());
Review Comment:
I'd rather add willSucceedFast() or isDone() or any similar check before
join. Currently it's not that important, however it might ease the debug in
future if we will use another placement driver implementation instead of
current test one and join will hang.
--
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]