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

[jira] [Updated] (IGNITE-25859) Implement pessimistic case of create zone on unstable topology

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

Mikhail Efremov updated IGNITE-25859:
-------------------------------------
    Description: 
*Description*

In https://issues.apache.org/jira/browse/IGNITE-25824 there was implementation of optimistic case when user creates a zone on stable logical topology (LT). But let's assume that a cluster starts 3 nodes (A, B, C) where B hosts a special storage profile P_b, all 3 nodes are started, thus every node sees itself in logical topology, let A be a CMG leader, then A sees B and C in logical topology and want to replicate it through raft. Node B received the corresponding raft  command, but node C didn't yet. So:
# Node A sees in LT (A, B, C).
# Node B sees in LT (A, B, C).
# Node C sees in LT (A, C).

User tries to query create zone on node C with storage profile P_b because he knows that:
- Every node in the cluster is started
- P_b is on node B

So the user assumes that query will complete successfully, but local logical topology on node C doesn't contain node B and then node C can't knows P_b and user will get an exception.

The proposal is to add distributed request of actual LT from CMG leader in the follow way:


{code:java}
        try {
            notPresentedStorageProfileName = logicalTopologyService.logicalTopologyOnLeader()
                    .thenApply(topologySnapshot -> findStorageProfileNotPresentedInLogicalTopologySnapshot(
                            storageProfiles,
                            topologySnapshot
                    )).get(10, TimeUnit.SECONDS);
        } catch (InterruptedException | ExecutionException | TimeoutException e) {
            String msg = format(
                    "Storage profile {} doesn't exist in local topology snapshot with profiles [{}], and distributed refresh failed.",
                    notPresentedStorageProfileName,
                    localLogicalTopologySnapshot.nodes().stream().map(LogicalNode::storageProfiles).collect(Collectors.toSet())
            );

            throw new SqlException(STMT_VALIDATION_ERR, msg, e);
        }
{code}

*Motivation*

We shouldn't break user's expectations on query execution.

*Definition of done*

# Implement the described pessimistic case on zone create process.
# Implement a test that reflects the described scenario.

  was:
*Description*

In https://issues.apache.org/jira/browse/IGNITE-25859 there was implementation of optimistic case when user creates a zone on stable logical topology (LT). But let's assume that a cluster starts 3 nodes (A, B, C) where B hosts a special storage profile P_b, all 3 nodes are started, thus every node sees itself in logical topology, let A be a CMG leader, then A sees B and C in logical topology and want to replicate it through raft. Node B received the corresponding raft  command, but node C didn't yet. So:
# Node A sees in LT (A, B, C).
# Node B sees in LT (A, B, C).
# Node C sees in LT (A, C).

User tries to query create zone on node C with storage profile P_b because he knows that:
- Every node in the cluster is started
- P_b is on node B

So the user assumes that query will complete successfully, but local logical topology on node C doesn't contain node B and then node C can't knows P_b and user will get an exception.

The proposal is to add distributed request of actual LT from CMG leader in the follow way:


{code:java}
        try {
            notPresentedStorageProfileName = logicalTopologyService.logicalTopologyOnLeader()
                    .thenApply(topologySnapshot -> findStorageProfileNotPresentedInLogicalTopologySnapshot(
                            storageProfiles,
                            topologySnapshot
                    )).get(10, TimeUnit.SECONDS);
        } catch (InterruptedException | ExecutionException | TimeoutException e) {
            String msg = format(
                    "Storage profile {} doesn't exist in local topology snapshot with profiles [{}], and distributed refresh failed.",
                    notPresentedStorageProfileName,
                    localLogicalTopologySnapshot.nodes().stream().map(LogicalNode::storageProfiles).collect(Collectors.toSet())
            );

            throw new SqlException(STMT_VALIDATION_ERR, msg, e);
        }
{code}

*Motivation*

We shouldn't break user's expectations on query execution.

*Definition of done*

# Implement the described pessimistic case on zone create process.
# Implement a test that reflects the described scenario.


> Implement pessimistic case of create zone on unstable topology 
> ---------------------------------------------------------------
>
>                 Key: IGNITE-25859
>                 URL: https://issues.apache.org/jira/browse/IGNITE-25859
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Mikhail Efremov
>            Assignee: Mikhail Efremov
>            Priority: Major
>              Labels: ignite-3
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> *Description*
> In https://issues.apache.org/jira/browse/IGNITE-25824 there was implementation of optimistic case when user creates a zone on stable logical topology (LT). But let's assume that a cluster starts 3 nodes (A, B, C) where B hosts a special storage profile P_b, all 3 nodes are started, thus every node sees itself in logical topology, let A be a CMG leader, then A sees B and C in logical topology and want to replicate it through raft. Node B received the corresponding raft  command, but node C didn't yet. So:
> # Node A sees in LT (A, B, C).
> # Node B sees in LT (A, B, C).
> # Node C sees in LT (A, C).
> User tries to query create zone on node C with storage profile P_b because he knows that:
> - Every node in the cluster is started
> - P_b is on node B
> So the user assumes that query will complete successfully, but local logical topology on node C doesn't contain node B and then node C can't knows P_b and user will get an exception.
> The proposal is to add distributed request of actual LT from CMG leader in the follow way:
> {code:java}
>         try {
>             notPresentedStorageProfileName = logicalTopologyService.logicalTopologyOnLeader()
>                     .thenApply(topologySnapshot -> findStorageProfileNotPresentedInLogicalTopologySnapshot(
>                             storageProfiles,
>                             topologySnapshot
>                     )).get(10, TimeUnit.SECONDS);
>         } catch (InterruptedException | ExecutionException | TimeoutException e) {
>             String msg = format(
>                     "Storage profile {} doesn't exist in local topology snapshot with profiles [{}], and distributed refresh failed.",
>                     notPresentedStorageProfileName,
>                     localLogicalTopologySnapshot.nodes().stream().map(LogicalNode::storageProfiles).collect(Collectors.toSet())
>             );
>             throw new SqlException(STMT_VALIDATION_ERR, msg, e);
>         }
> {code}
> *Motivation*
> We shouldn't break user's expectations on query execution.
> *Definition of done*
> # Implement the described pessimistic case on zone create process.
> # Implement a test that reflects the described scenario.



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