You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Evgeny Stanilovsky (Jira)" <ji...@apache.org> on 2025/06/09 15:58:00 UTC

[jira] [Assigned] (IGNITE-25600) Sql. FragmentMappingTest need to have a possibility to test cases with mapOnBackup=false

     [ https://issues.apache.org/jira/browse/IGNITE-25600?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Evgeny Stanilovsky reassigned IGNITE-25600:
-------------------------------------------

    Assignee: Evgeny Stanilovsky

> Sql. FragmentMappingTest need to have a possibility to test cases with mapOnBackup=false
> ----------------------------------------------------------------------------------------
>
>                 Key: IGNITE-25600
>                 URL: https://issues.apache.org/jira/browse/IGNITE-25600
>             Project: Ignite
>          Issue Type: Test
>          Components: sql ai3
>            Reporter: Evgeny Stanilovsky
>            Assignee: Evgeny Stanilovsky
>            Priority: Major
>              Labels: ignite-3
>
> FragmentMappingTest is always executed with mapOnBackup = true, need to also have a possibilty to run it with mapOnBackup = false.
> Now test execution is goes through:
> MappingTestRunner#produceMapping with: 
> {code:java}
> mappedFragments = await(mappingService.map(plan, MappingParameters.EMPTY));
> {code}
> and we can see that MappingParameters.EMPTY -> mapOnBackups == false but it not considered in further assignments calculations, check:
> {code:java}
> ExecutionDistributionProviderBuilder#build
> {code}
> and thus all possible through assignments nodes are goes into further consideration.
> Code need to be changed on smth like :
> {noformat}
>         public ExecutionDistributionProvider build() {
>             Map<String, List<List<String>>> owningNodesByTableName = Map.copyOf(this.owningNodesByTableName);
>             Function<String, AssignmentsProvider> sourceProviderFunction = tableName ->
>                     (AssignmentsProvider) (partitionsCount, includeBackups) -> {
>                         List<List<String>> assignments = owningNodesByTableName.get(tableName);
>                         if (nullOrEmpty(assignments)) {
>                             throw new AssertionError("Assignments are not configured for table " + tableName);
>                         }
>                         if (includeBackups) {
>                             return assignments;
>                         } else {
>                             List<List<String>> primaryAssignments = new ArrayList<>();
>                             for (List<String> assign : assignments) {
>                                 primaryAssignments.add(List.of(assign.get(0)));
>                             }
>                             return primaryAssignments;
>                         }
>                     };
>             return new TestExecutionDistributionProvider(
>                     owningNodesBySystemViewName,
>                     sourceProviderFunction,
>                     useTablePartitions
>             );
>         }
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)