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

Alexander Lapin updated IGNITE-15215:
-------------------------------------
    Description: 
After implementing IGNITE-15148 it's possible to unmute 
DynamicTableCreationTest that were disabled because of lack of node stop.

Occurred that there were few bugs involved:
 # There was a race between raft group and raft service creation.
 # Raft group name pattern was 
{code:java}
private static final Pattern GROUP_ID_PATTER = 
Pattern.compile("^[a-zA-Z][a-zA-Z0-9\\-_]*$");
{code}
despite the fact that partitioned raft group could start with numbers:
{code:java}
@NotNull private String raftGroupName(UUID tableId, int partition) {
    return tableId + "_part_" + partition;
}
{code}
where tableId is UUID.

So in order to fix issue 1: GetLeaderRequestProcessor.java  was updated. 
Instead of returning ILLEGAL_STATE now it returns NO_LEADER if there's no raft 
node with given name. It will lead to few retries until success or timeout, see 
org.apache.ignite.raft.client.service.impl.RaftGroupServiceImpl#sendWithRetry 
for more details
{code:java}
else if (resp0.errorCode().equals(NO_LEADER)) {
    executor.schedule(() -> {
        sendWithRetry(randomNode(), req, stopTime, fut);

        return null;
    }, retryDelay, TimeUnit.MILLISECONDS);
}
{code}
In order to fix issue 2: pattern was changed to
{code:java}
private static final Pattern GROUP_ID_PATTER = 
Pattern.compile("^[0-9a-zA-Z][a-zA-Z0-9\\-_]*$");
{code}

  was:
After implementing IGNITE-15148 it's possible to unmute tests that were 
disabled because of lack of node stop.

Occurred that there were few bugs involved:
 # There was a race between raft group and raft service creation.
 # Raft group name pattern was 
{code:java}
private static final Pattern GROUP_ID_PATTER = 
Pattern.compile("^[a-zA-Z][a-zA-Z0-9\\-_]*$");
{code}
despite the fact that partitioned raft group could start with numbers:
{code:java}
@NotNull private String raftGroupName(UUID tableId, int partition) {
    return tableId + "_part_" + partition;
}
{code}
where tableId is UUID.

So in order to fix issue 1: GetLeaderRequestProcessor.java  was updated. 
Instead of returning ILLEGAL_STATE it now returns NO_LEADER if there's no raft 
node with given name. It will lead to few retries until success or timeout, see 
org.apache.ignite.raft.client.service.impl.RaftGroupServiceImpl#sendWithRetry 
for more details
{code:java}
else if (resp0.errorCode().equals(NO_LEADER)) {
    executor.schedule(() -> {
        sendWithRetry(randomNode(), req, stopTime, fut);

        return null;
    }, retryDelay, TimeUnit.MILLISECONDS);
}
{code}
In order to fix issue 2: pattern was changed to
{code:java}
private static final Pattern GROUP_ID_PATTER = 
Pattern.compile("^[0-9a-zA-Z][a-zA-Z0-9\\-_]*$");
{code}


> Unmute and fix DynamicTableCreationTest that were disabled because of lack of 
> node stop
> ---------------------------------------------------------------------------------------
>
>                 Key: IGNITE-15215
>                 URL: https://issues.apache.org/jira/browse/IGNITE-15215
>             Project: Ignite
>          Issue Type: Improvement
>            Reporter: Alexander Lapin
>            Assignee: Alexander Lapin
>            Priority: Major
>              Labels: ignite-3
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> After implementing IGNITE-15148 it's possible to unmute 
> DynamicTableCreationTest that were disabled because of lack of node stop.
> Occurred that there were few bugs involved:
>  # There was a race between raft group and raft service creation.
>  # Raft group name pattern was 
> {code:java}
> private static final Pattern GROUP_ID_PATTER = 
> Pattern.compile("^[a-zA-Z][a-zA-Z0-9\\-_]*$");
> {code}
> despite the fact that partitioned raft group could start with numbers:
> {code:java}
> @NotNull private String raftGroupName(UUID tableId, int partition) {
>     return tableId + "_part_" + partition;
> }
> {code}
> where tableId is UUID.
> So in order to fix issue 1: GetLeaderRequestProcessor.java  was updated. 
> Instead of returning ILLEGAL_STATE now it returns NO_LEADER if there's no 
> raft node with given name. It will lead to few retries until success or 
> timeout, see 
> org.apache.ignite.raft.client.service.impl.RaftGroupServiceImpl#sendWithRetry 
> for more details
> {code:java}
> else if (resp0.errorCode().equals(NO_LEADER)) {
>     executor.schedule(() -> {
>         sendWithRetry(randomNode(), req, stopTime, fut);
>         return null;
>     }, retryDelay, TimeUnit.MILLISECONDS);
> }
> {code}
> In order to fix issue 2: pattern was changed to
> {code:java}
> private static final Pattern GROUP_ID_PATTER = 
> Pattern.compile("^[0-9a-zA-Z][a-zA-Z0-9\\-_]*$");
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to