Vladimir Kirchev
unread,Feb 15, 2012, 5:42:30 AM2/15/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Hazelcast
Hi, Fuad,
Here is some more info.
We use a queue, which is backed by an IMap using MapStore.
They are configured in the following way:
QueueConfig mainQueueConfig = new QueueConfig();
mainQueueConfig.setName("DISTRIBUTED_QUEUE");
mainQueueConfig.setMaxSizePerJVM(0);
mainQueueConfig.setBackingMapRef("DISTRIBUTED_MAP");
MapStoreConfig mapStoreConfig = new MapStoreConfig();
mapStoreConfig.setEnabled(true);
mapStoreConfig.setWriteDelaySeconds(0); // write-through, synchronous
with put
mapStoreConfig.setImplementation(mapStore);
MapConfig queueBackupMapConfig = new MapConfig();
queueBackupMapConfig.setMapStoreConfig(mapStoreConfig);
queueBackupMapConfig.setName(DISTRIBUTED_REGULATIONS_MAP);
queueBackupMapConfig.setBackupCount(0);
queueBackupMapConfig.setEvictionPolicy("NONE");
queueBackupMapConfig.getMaxSizeConfig().setMaxSizePolicy("cluster_wide_map_size");
queueBackupMapConfig.getMaxSizeConfig().setSize(0);
queueBackupMapConfig.setMergePolicy("hz.ADD_NEW_ENTRY");
Config config = new Config();
config.addQueueConfig(mainQueueConfig);
config.addMapConfig(queueBackupMapConfig);
So we have two nodes A and B.
On Node A, we have code that puts to the Queue, and on Node B we have
code that gets from the Queue.
Initially when the two nodes are started the puts and gets work
correctly.
But when Node B is restarted, it blocks on queue.take(), even though
the queue is not empty. It stays this way until Node A is stopped or
restarted. Only then Nobe B is able to process the elements in the
queue.
We noticed the opposite behavior, Node A blocks on queue.offer() but
we still are not able to reproduce it.
About the hazelcast logs, I was not able to make it log anything but
INFO messages.
If you need more info, let me know.
- Vladimir Kirchev