ReplicatedMap.get makes remote call?

9 views
Skip to first unread message

Niels Ull Harremoës

unread,
Nov 24, 2021, 11:29:24 AM11/24/21
to Hazelcast
Hi!

Sorry for repeating a question I also asked on Stack overflow, but I did not get a relevant answer?

We are using a ReplicatedMap in a Hazelcast client. Client and server are both version 4.2.1.

The map is quite small (<10 entries, each value less than 100 bytes). The client only reads from the map, which is updated infrequently on the server.

We expected ReplicatedMap.get to be non-blocking, but during a long running performance test, we started getting warnings like the one below from vertx (which monitors for blocked threads). The first error came after 6 hours, so it is not easily reproduced.

Is there any way to do a non-blocking get? Or do we need to add an EntryListener, which maintains a local ConcurrentHashmap?

Clarification: The real issue here is not blocking vertx (which can be solved by moving the call to a Vertx worker verticle), but rather avoiding delaying the lookup. The business requirement is that we process messages in 50 ms or less, so even if we moved the call to a worker, we would be unable to fulfill that.

[vertx-blocked-thread-checker] WARN io.vertx.core.impl.BlockedThreadChecker - Thread Thread[vert.x-eventloop-thread-0,5,main] has been blocked for 12777 ms, time limit is 2000 ms io.vertx.core.VertxException: Thread blocked at jdk.internal.misc.Unsafe.park(Native Method) ~[?:?] at java.util.concurrent.locks.LockSupport.park(LockSupport.java:323) ~[?:?] at com.hazelcast.spi.impl.AbstractInvocationFuture.manageParking(AbstractInvocationFuture.java:693) ~[hazelcast-4.2.1.jar!/:4.2.1] at com.hazelcast.spi.impl.AbstractInvocationFuture.get(AbstractInvocationFuture.java:615) ~[hazelcast-4.2.1.jar!/:4.2.1] at com.hazelcast.client.impl.spi.ClientProxy.invokeOnPartition(ClientProxy.java:188) ~[hazelcast-4.2.1.jar!/:4.2.1] at com.hazelcast.client.impl.spi.ClientProxy.invoke(ClientProxy.java:182) ~[hazelcast-4.2.1.jar!/:4.2.1] at com.hazelcast.client.impl.proxy.ClientReplicatedMapProxy.get(ClientReplicatedMapProxy.java:214) ~[hazelcast-4.2.1.jar!/:4.2.1] at my.package.StateGetter.getState(StateGetter.java:44) ~[classes!/:1.5.189]

Vassilis Bekiaris

unread,
Nov 25, 2021, 3:28:15 AM11/25/21
to Hazelcast
Hi Niels,

I think that what you are looking for is to configure near cache (https://docs.hazelcast.com/imdg/4.2/performance/near-cache) on your client. ReplicatedMap entries are replicated across all members of the cluster, but clients still need to perform a remote call to a member to get a value. With near cache, your client will cache entries locally and invalidate as needed.

Best,
Vassilis
This message contains confidential information and is intended only for the individuals named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required, please request a hard-copy version. -Hazelcast

ni...@harremoes.dk

unread,
Nov 25, 2021, 7:12:50 AM11/25/21
to haze...@googlegroups.com

Thank you very much - I had apparently not realised the difference between lcients and members for ReplicatedMaps.

Regards, Niels

--
You received this message because you are subscribed to a topic in the Google Groups "Hazelcast" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/hazelcast/orUx-7Ioeb0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to hazelcast+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/0db63f9b-745e-432d-9c4f-49b9b1a6af50n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages