hazelcast / hazelcast/hazelcast-python-client

[TRACKING ISSUE] Don't allow empty memberlist on cluster id changes [API-1215]

Open
#543 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
116
Forks
78
Avg merge
10d 22h
Merged PRs (30d)
1

Description

The tracking issue for the Java side PR.

See https://github.com/hazelcast/hazelcast/pull/20818 for details.

---

When cluster id changed we were resetting member list
with an empty memberlist. It turned out that there are implementations
that assumes it will never be empty.

Following test failure is an example of it.
https://github.com/hazelcast/hazelcast/issues/20264

Instead of clearing the memberlist on cluster id change, we
are keeping the cluster id as part of the latest snapshot
to be able to fire correct events. In other words, on cluster restart
we need to fire removed events for all old members and added
events for all new members coming from restarted cluster.
We were achieving this via clearing memberlist and firing removed
events first. Then after some time new memberlist comes and we fire
added events. And the memberlist is empty during this period.
To prevent that, we have changed the logic. Now `clusterUuid` is
part of the logic. We don't clear the memberlist at all. Upon receiving,
an event, we compare existing and new clusterUuid. If they are different,
without comparing the members, we fire removed events for all existing
members, and added events for all new ones to achieve same behaviour.

Note that clearing memberlist on cluster id change was
introduced as a fix to https://github.com/hazelcast/hazelcast/pull/18245
So it is important not to break related ClientHotRestartTest

fixes https://github.com/hazelcast/hazelcast/issues/20264

Checklist:
- [x] Labels (`Team:`, `Type:`, `Source:`, `Module:`) and Milestone set
- [x] Label `Add to Release Notes` or `Not Release Notes content` set
- [x] Request reviewers if possible
- [ ] Send backports/forwardports if fix needs to be applied to past/future releases
- [ ] New public APIs have `@Nonnull/@Nullable` annotations
- [ ] New public APIs have `@since` tags in Javadoc

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.