denis-chudov commented on code in PR #2867:
URL: https://github.com/apache/ignite-3/pull/2867#discussion_r1414228310


##########
modules/distribution-zones/src/main/java/org/apache/ignite/internal/distributionzones/rebalance/RebalanceUtil.java:
##########
@@ -516,25 +515,28 @@ static CompletableFuture<List<Set<Assignment>>> 
tableAssignments(
     }
 
     /**
-     * Returns table assignments for all table partitions from vault.
+     * Returns table assignments for all table partitions from meta storage 
locally.
      *
-     * @param vaultManager Vault manager.
+     * @param metaStorageManager Meta storage manager.
      * @param tableId Table id.
      * @param numberOfPartitions Number of partitions.
+     * @param revision Revision.
      * @return Future with table assignments as a value.
      */
     public static List<Set<Assignment>> tableAssignments(
-            VaultManager vaultManager,
+            MetaStorageManager metaStorageManager,
             int tableId,
-            int numberOfPartitions
+            int numberOfPartitions,
+            long revision
     ) {
         return IntStream.range(0, numberOfPartitions)
-                .mapToObj(i ->
-                        (Set<Assignment>) ByteUtils.fromBytes(
-                                vaultManager.get(
-                                        stablePartAssignmentsKey(new 
TablePartitionId(tableId, i))
-                                ).join().value())
-                )
+                .mapToObj(p -> {
+                    Entry e = 
metaStorageManager.getLocally(stablePartAssignmentsKey(new 
TablePartitionId(tableId, p)), revision);
+
+                    assert !e.empty() && !e.tombstone() : e;

Review Comment:
   Because we first check the presence of assignments for one partition, and 
then presume that others are also present. If some partitions missing, this is 
some kind of corruption and we throw assertion.



-- 
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]

Reply via email to