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

MapLoader.loadAll(true) doesn't reload after reloading with new keys #9255

Closed
gAmUssA opened this issue Nov 14, 2016 · 6 comments

Comments

Projects
None yet
3 participants
@gAmUssA
Copy link

commented Nov 14, 2016

Reproducer: https://github.com/amitgsoni/hazelcast

  1. Start cache server (Don't load any map)
  2. Load map first time --> Using com.hazelcast.client.HazelcastClient.getMap().size()
  3. Reload Update key(s) of given map --> Using com.hazelcast.client.HazelcastClient getMap().loadAll(keys, true);

-- Once we do operation of step-3 the getMap().loadAll(true) is not working as expected

ZD 2149

@jerrinot

This comment has been minimized.

Copy link
Contributor

commented Nov 15, 2016

@gAmUssA: I'm looking at the reproducer. Can you please elaborate the "Once we do operation of step-3 the getMap().loadAll(true) is not working as expected" statement?

What is supposed to happen and what's actually happening?

@gAmUssA

This comment has been minimized.

Copy link
Author

commented Nov 15, 2016

use case 1

  • map has maploader
  • hz.getMap invokes loadAllKeys, loadAll
  • hz.getMap.loadAll(true) invokes loadAll

all good here

use case 2

  • map has maploader
  • hz.getMap invokes loadAllKeys, loadAll
  • new set of keys
  • hz.getMap.loadAdd(keys, true) invokes loadAll for new set of keys
  • hz.getMap.loadAll(true) doesn't work.

Thank you

@jerrinot

This comment has been minimized.

Copy link
Contributor

commented Nov 15, 2016

a further clarification from @gAmUssA: "hz.getMap.loadAll(true) doesn't work." == Map Loader is not invoked

@gAmUssA

This comment has been minimized.

Copy link
Author

commented Nov 15, 2016

@jerrinot let me know if you need any further clarification

@jerrinot

This comment has been minimized.

Copy link
Contributor

commented Nov 15, 2016

I did a little bit of debugging and when hz.getMap.loadAdd(keys, true) is called then the subsequent loadAll(true) will be no-op because the state here will be still LOADING.

jerrinot added a commit to jerrinot/hazelcast that referenced this issue Nov 16, 2016

loadAll(keys) has to notify RecordStores about the end of loading
When a RecordStore process LoadAllOperation it expects to receive
LoadStatusOperation eventually. The LoadStatusOperation indicates
there are no more keys to be loaded. Without this the record store never
change its state int the Loaded state -> subsequent loadAll() calls are ignored

Fixes hazelcast#9255

jerrinot added a commit to jerrinot/hazelcast that referenced this issue Nov 16, 2016

Do not change keyLoaderState when loading keys supplied by user
The LoadAllOperation is used in 2 contexts:
1. loadAll() - when all entries are reloaded
2. loadAll(keys) - when reload of specific keys is requested by user

The first case uses a complex key-loading coordination and state transitions,
while the 2nd case is fairly simple - every member receives a set of keys
directly from the user.

This changeset fix the behaviour in the 2nd case where the
state was changed by accident and this led to a buggy
behaviour.

Fixes hazelcast#9255

jerrinot added a commit to jerrinot/hazelcast that referenced this issue Nov 16, 2016

Do not change keyLoaderState when loading keys supplied by user
The LoadAllOperation is used in 2 contexts:
1. loadAll() - when all entries are reloaded
2. loadAll(keys) - when reload of specific keys is requested by user

The first case uses a complex key-loading coordination and state transitions,
while the 2nd case is fairly simple - every member receives a set of keys
directly from the user.

This changeset fix the behaviour in the 2nd case where the
state was changed by accident and this led to a buggy
behaviour.

Fixes hazelcast#9255

(cherry picked from commit 734509d)

jerrinot added a commit to jerrinot/hazelcast that referenced this issue Nov 16, 2016

Do not change keyLoaderState when loading keys supplied by user
The LoadAllOperation is used in 2 contexts:
1. loadAll() - when all entries are reloaded
2. loadAll(keys) - when reload of specific keys is requested by user

The first case uses a complex key-loading coordination and state transitions,
while the 2nd case is fairly simple - every member receives a set of keys
directly from the user.

This changeset fix the behaviour in the 2nd case where the
state was changed by accident and this led to a buggy
behaviour.

Fixes hazelcast#9255

(cherry picked from commit 734509d)

tombujok added a commit that referenced this issue Nov 16, 2016

Do not change keyLoaderState when loading keys supplied by user (#9263)
The LoadAllOperation is used in 2 contexts:
1. loadAll() - when all entries are reloaded
2. loadAll(keys) - when reload of specific keys is requested by user

The first case uses a complex key-loading coordination and state transitions,
while the 2nd case is fairly simple - every member receives a set of keys
directly from the user.

This changeset fix the behaviour in the 2nd case where the
state was changed by accident and this led to a buggy
behaviour.

Fixes #9255

(cherry picked from commit 734509d)

jerrinot added a commit to jerrinot/hazelcast that referenced this issue Nov 21, 2016

Do not change keyLoaderState when loading keys supplied by user
The LoadAllOperation is used in 2 contexts:
1. loadAll() - when all entries are reloaded
2. loadAll(keys) - when reload of specific keys is requested by user

The first case uses a complex key-loading coordination and state transitions,
while the 2nd case is fairly simple - every member receives a set of keys
directly from the user.

This changeset fix the behaviour in the 2nd case where the
state was changed by accident and this led to a buggy
behaviour.

Fixes hazelcast#9255
(cherry picked from commit 4614c94)

jerrinot added a commit to jerrinot/hazelcast that referenced this issue Nov 29, 2016

Do not change keyLoaderState when loading keys supplied by user
The LoadAllOperation is used in 2 contexts:
1. loadAll() - when all entries are reloaded
2. loadAll(keys) - when reload of specific keys is requested by user

The first case uses a complex key-loading coordination and state transitions,
while the 2nd case is fairly simple - every member receives a set of keys
directly from the user.

This changeset fix the behaviour in the 2nd case where the
state was changed by accident and this led to a buggy
behaviour.

Fixes hazelcast#9255

(cherry picked from commit 4614c94)

@jerrinot jerrinot assigned jerrinot and unassigned tombujok Dec 2, 2016

@jerrinot jerrinot assigned tombujok and unassigned jerrinot Dec 13, 2016

@jerrinot

This comment has been minimized.

Copy link
Contributor

commented Dec 13, 2016

assigning to Tom as discussed.

tombujok added a commit to tombujok/hazelcast that referenced this issue Dec 19, 2016

tombujok added a commit to tombujok/hazelcast that referenced this issue Dec 19, 2016

tombujok added a commit that referenced this issue Dec 20, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.