Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metadata batch operation may delete raftStore's instance data. #4699

Closed
horizonzy opened this issue Jan 14, 2021 · 0 comments
Closed

Metadata batch operation may delete raftStore's instance data. #4699

horizonzy opened this issue Jan 14, 2021 · 0 comments
Labels
kind/bug Category issues or prs related to bug.

Comments

@horizonzy
Copy link
Collaborator

Describe the bug
The code as follow:

    private Instance locateInstance(List<Instance> instances, Instance instance) {
        int target = 0;
        while (target >= 0) {
            target = instances.indexOf(instance);
            if (target >= 0) {
                Instance result = instances.get(target);
                if (result.getClusterName().equals(instance.getClusterName())) {
                    return result;
                }
                instances.remove(target);
            }
        }
        return null;
    }

The first param instances get from raftStore, the instance's equals method be override, it judge (ip + port + ephemeral), when instance equals return true, then judge clusterName is equals.

In the code, if instance equals, but cluster name not equlas, the instance will be remove.

@horizonzy horizonzy added the kind/bug Category issues or prs related to bug. label Jan 14, 2021
horizonzy added a commit that referenced this issue Jan 15, 2021
[ISSUE-#4699] Fix metadata batch operation may delete instance problem.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Category issues or prs related to bug.
Projects
None yet
Development

No branches or pull requests

1 participant