It seems to me that EVT_CACHE_REBALANCE_OBJECT_LOADED
events are coming on the backup node of their entries.
I have a partitioned cache, with 1 backup copy configured.
After a cluster node is killed (out of say 3 or 4 running initially), a rebalance happens, and I observe EVT_CACHE_REBALANCE_OBJECT_LOADED events using ignite.events().localListen(...)
. If I check where this event.key()
maps to by calling affinity.mapKeyToNode(key)
, I get a node for which isLocal()
is false.
I also check mapKeyToPrimaryAndBackups(key)
, and indeed, the second node in the returned collection says that its isLocal()
is true
.
I also double check it by re-querying local entries on each node by local ScanQuery()
, and it confirms the above, i.e. whatever I received with EVT_CACHE_REBALANCE_OBJECT_LOADED
, has primary node which is different from where I receive it.
I.e. the EVT_CACHE_REBALANCE_OBJECT_LOADED
event never comes on primary node of the event's object, but always on the backup node.
So... is it correct at all?
Thanks, I would appreciate help on that - spent quite some time so far on that, any clue would matter!!
EDIT1: To clarify, the event never comes on the primary node as it should in according to the doco (added it to the title too)
EDIT2: the documentation actually says "The node where the object is loaded.", without being specific about primary or backup nodes. So it can happen on the backup node. Problem is, it does not happen on the primary node.
EDIT3:
I think I figured it out. The EVT_CACHE_REBALANCE_OBJECT_LOADED
is supposed to tell only about physical loading of an object into the node, regardless if the object goes into its Primary or Backup partition. So if on a data rebalance, a partition on the local node is just toggled from being Backup to Primary (which happens in my tests), then this event is not coming, and not supposed to, for the objects in the toggled partition. Would be good to confirm it from the Ignite devs, because TBH the docos (either javadoc or HTML) are a bit vague on the Ignite events.
EVT_CACHE_REBALANCE_OBJECT_LOADED
indicates that an entry is loaded to the specified node during Data Rebalancing. This includes backup nodes.