Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Jaromir Hamala
    @jerrinot

    @AdamUlatowski: data structures without explicit configuration will use a default configuration. changing a default configuration is as simple as adding a regular configuration named "default". in your case something like this:

    <pn-counter name="default">
      <replica-count>someNumber</replica-count>
      <statistics-enabled>true</statistics-enabled>
    </pn-counter>

    or if you prefer yaml

    pn-counter:
      default:
        replica-count: some-number
        statistics-enabled: true

    alternatively you can use wildcard matching:

    <pn-counter name="my*">
      <replica-count>someNumber</replica-count>
      <statistics-enabled>true</statistics-enabled>
    </pn-counter>

    Then all PNCounters with a name starting with "my" will use this configuration.

    Jaromir Hamala
    @jerrinot

    Bear in mind PNCounters are eventually consistent: All replicas will eventually converge to a same value, but this process is asynchronous.
    This may or may not be OK, depending on our use-case. For example it is not suitable as an ID generator - as it can generate duplicates - but it's usually a good if you are counting occurrences of some event. It's called a counter after all:) The main advantage is that the counters are always available.

    the Raft-based counters are on the opposite side of the consistency spectrum: They are linearizable. This means when an increment is acknowledged then subsequent read operations are guaranteed to see it. The flip-side is that Raft structures are unavailable when there is not a quorum. (when half of your CP group members are unavailable)

    AdamUlatowski
    @AdamUlatowski

    @jerrinot Thank you very much for clarification. I didn't want to change default values because it can affect other microservices using PN Counters so we don't want to provide specific microservice configuration into our shared cluster.

    Great we can use wildcard matching! Could you confirm i can use it from my Hazelcast Client Side e.g. :

    HazelcastInstance hazelcastInstance = HazelcastClient.newHazelcastClient(clientConfig);
    PNCounterConfig pnCounterConfig = new PNCounterConfig("my*")
         .setReplicaCount(<someNumber>)
         .setStatisticsEnabled(true);
    hazelcastInstance.getConfig()
         .addPNCounterConfig(pnCounterConfig);

    What do you mean by Raft-based counters? Does it mean based on Raft consensus algorithm (implememtation of java concurrency primitivies)?

    Jaromir Hamala
    @jerrinot

    the snippet looks good to me :thumbsup:
    you just have to make sure to submit the configuration before you start using the counter.

    indeed, the CP-subsystem is based on the Raft consensus protocol (when you enable it).
    So you can have IAtomicLong backed by the Raft protocol. See the reference manual for details: https://docs.hazelcast.org/docs/4.0.2/manual/html-single/index.html#cp-subsystem

    AdamUlatowski
    @AdamUlatowski
    Thank you @jerrinot !
    Last question, can we use PNCounters without enabling CP Subsystem? I assume yes because i cannot find anything in related to it in doc regarding PNCounters.
    That was our motivation bacause we don't want to enable CPSubsystem
    Andrey Pechkurov
    @puzpuzpuz
    Hi @AdamUlatowski. PNCounters don't depend on CP Subsystem, so you don't need to enable it in order to use them.
    They're CRDTs (https://en.wikipedia.org/wiki/Conflict-free_replicated_data_type) and thus assume eventual consistency
    Vishal Patil
    @pa-vishal

    @pa-vishal what you described is a normal behaviour of a queue: when you have a queue with multiple consumers (listeners) and you submit a new item into a queue then only a signle consumer will receive the item. do you observe a different behaviour?

    @jerrinot , I absolutely see a different behavior- when I put a message on the IQueue from server, all the 3 listeners in 3 instances (configured as HazelcastClient) receive the item. Am I missing something?

    Jaromir Hamala
    @jerrinot
    Do you have a reproducer?
    Vishal Patil
    @pa-vishal
    I will try to write one. How can I continue on this thread and where shall I reach you?
    My current server cluster setup is on Eureka
    and client connect to server by discovery
    Jaromir Hamala
    @jerrinot
    The simpler the reproducer the better. It's best to reach out to me here, this way others reading this chat can learn something too. feel free to @tag me.
    Jaromir Hamala
    @jerrinot

    @pa-vishal I guess I know what the problem is. A Queue listener is just a passive observer. It does not consume queue elements. When you have listeners registered on multiple clients then each listeners will be invoke for each item.
    This is probably not what you want. Not only multiple listeners will be invoked for each item, but the items won't ever be consumer and the queue will leak memory.

    You most likely do not want a queue listener, but a queue consumer. Please have a look at the reference manual how to consume queue: https://docs.hazelcast.org/docs/4.0.2/manual/html-single/index.html#taking-items-off-the-queue

    Vishal Patil
    @pa-vishal
    @jerrinot , rather than using a infinite while loop for polling on network , my solution would be to create a keyhash on items in the queue . I have described the solution here- https://groups.google.com/g/hazelcast/c/U_p_j4tOP5Q/m/WMQns18zBgAJ
    Also found an alternative to own keyhash, is to use the partitionId: int itemPartitionId = hz.getPartitionService().getPartition(item.getItem()).getPartitionId();
    Jaromir Hamala
    @jerrinot

    you cannot use use listeners. you need something to consume elements from the queue otherwise it will be leaking memory.

    if you prefer listeners and manual load balancing then you could use ITopic instead. It has listeners, but it does not retain items.

    Vishal Patil
    @pa-vishal
    @jerrinot , yes you are right, that's a great suggestion, ITopic makes more sense in scenarios like this.
    Jaromir Hamala
    @jerrinot
    :+1:
    AdamUlatowski
    @AdamUlatowski
    @puzpuzpuz Thank you very much for final clarification!
    dawidjasiokwork
    @dawidjasiokwork

    @jerrinot
    I checked your advice and it looks that it works. I mean almost because now we are facing with another problem.
    When I set max size policy to PER_NODE and 15000 entries I observe that during requesting to our application:

    • first instance has 15106 entries
    • second instance has 14940 entries
    • third instance has 14940 entries

    and the limit is restricted so each instance never contains more than this.
    For me it looks ok, I see in logs that entires are evicted.
    But when i set USED_HEAP_SIZE on 100MB (does it mean 50MB per entries memory and 50MB per backup right?) I observe that when each instance reachs 50MB then eviction is started (mostly it happens after 10000 entries per instance). But when I request for example for another 1000000 entries and we have 1000000 putAsync operations, memory grows more than 50MB:

    • first instance has 84 MB per memory entries, 16 MB backup memory
    • second instance has 84 MB memory entries, 16 MB backup memory

    summing up the memory on each instance we still have the 100 MB but the distribution is different, only 16 MB for backup. Is this appropriate behavior?

    image.png
    Jaromir Hamala
    @jerrinot

    @dawidjasiokwork
    I'm glad the threshold is being respected when configured properly.

    the primary/backup imbalance looks like a possible bug in eviction. for some reason backups entries are evicted more frequently then primaries.
    please open a new ticket at https://github.com/hazelcast/hazelcast/issues/new and describe your scenario. thanks!

    murali474
    @murali474

    hi ,
    Currently i am using client sever topology model with 5 java clients .All 5 java clients are web applications and am getting below error in logs.

    Failed to execute java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@6bb6a27
    java.lang.NoClassDefFoundError: com/hazelcast/client/impl/protocol/util/BufferBuilder

    could some one guide me to fix this.

    murali474
    @murali474

    and the other error is getting printed in logs continuously is as below.

    Illegal access: this web application instance has been stopped already.
    Could not load [com.hazelcast.client.impl.protocol.ClientMessage]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
    java.lang.IllegalStateException: I
    llegal access: this web application instance has been stopped already.
    Could not load [com.hazelcast.client.impl.protocol.ClientMessage].
    The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.

    Hazelcast
    @hazelcast_twitter
    [Peter Veentjer (peter.veentjer)] could it be that you have multiple versions of the same jars on the classpath?
    murali474
    @murali474
    i am deploying my applications in tomcat and i dont find any hazelcast jar in tomcat clas s path.
    Jaromir Hamala
    @jerrinot
    @murali474:
    It looks you had deployed a webapplication with an embedded Hazelcast. Then you undeployed the application from Tomcat, but the application failed to stop Hazelcast instance. You should always stop all Hazelcast instances when an application is being stopped. the simplest thing should be to call HazelcastInstance.shutdown() from a context listener. See an example here: https://www.codejava.net/java-ee/servlet/weblistener-annotation-examples
    Shivam Sharma
    @svmsharma20
    Hi All,
    One of our customers is facing high latency around 4 to 8 mins between publishing a message on an iTopic and receiving the message at subscribers' end. This delay is intermittent and happens around 4-5 times a day. As per the load on the infrastructure and GC utilization is normal. Any suggestions?
    Jaromir Hamala
    @jerrinot
    @svmsharma20:
    just a shot into dark: assuming the cluster is otherwise stable it could be caused by some other tasks occupying event threads. threadumps and java mission control could tell you more.
    4-8 minutes is indeed extreme
    Nabz
    @nabanita18
    Hi , we are trying to set up hazelcast in eks, but we are unable to bring up mancenter in EKS
    getting below error
    executing command specified by MC_INIT_CMD
    Unmatched arguments: cluster, add, --lenient=true, -H, /data, -cc, /config/hazelcast-client.yaml
    Did you mean: create-user or change-user-password or update-ldap-password?
    mancenter version:3.12.8
    Hazelcast
    @hazelcast_twitter
    [Andrey Pechkurov (Andrey)] How do you start Management Center and which image do you use? The command from the error output is inly supported in MC 4.0+
    Ramneek Khurana
    @ranmeekkhsc
    we are getting the same error as well
    using 3.12.8 image
    and same helm chart
    Hasan Çelik
    @hasancelik
    Hi @nabanita18, what is Hazelcast Helm chart version you installed? Probably, you were trying to install latest helm chart with 3.12.8 Management Center image. With 4.0 release, the way Management Center connects to and communicates with Hazelcast clusters has been changed so we have modified related commands and configurations at our Helm chart as well. To start 3.12.8 Management Center, you need to use 2.10.0 as a chart version --> helm install <name> --set <parameters> --version 2.10.0 hazelcast/hazelcast
    Sagar Raut
    @v8sagar
    hi all
    I am using IMDG, bucket4j, and AWS
    I want to set member IP and Port dynamically
    Any idea how I can achieve it?
    Jaromir Hamala
    @jerrinot
    @v8sagar please elaborate what do you mean dynamically. IP addresses are assigned by DHCP server ran by AWS. what are you trying to achieve?
    Sagar Raut
    @v8sagar
    @jerrinot I want to know if I am using hazelcast wiht Spring boot application and its run on two different servers with ELB
    will it work ?
    Do I need to install the hazelcast separately?
    Hazelcast
    @hazelcast_twitter
    [Rafal Leszko (unknown)] @v8sagar You can run it this way. Run Hazelcast embedded in Spring boot on two EC2 machines, use AWS Discovery plugin for discovery and then expose everything with ELB. I don't see any issue with that.
    Sagar Raut
    @v8sagar
    @hazelcast_twitter thanks
    @hazelcast_twitter can you give me an example to refer this will be good for me
    Hazelcast
    @hazelcast_twitter
    [Rafal Leszko (unknown)] I think this documentation is the best source: https://github.com/hazelcast/hazelcast-aws
    Sagar Raut
    @v8sagar
    @hazelcast_twitter thank you again
    Sagar Raut
    @v8sagar

    Hi all
    I am getting
    `[0.0.0.0]:8099 [dev] [4.0.2] While sending op error... op: com.hazelcast.internal.cluster.impl.operations.JoinMastershipClaimOp{serviceName='hz:core:clusterService', identityHash=188472785, partitionId=-1, replicaIndex=0, callId=5, invocationTime=1597066923255 (2020-08-10 19:12:03.255), waitTimeout=-1, callTimeout=60000}, error: java.lang.IllegalArgumentException: Target is this node! -> [0.0.0.0]:8099

    java.lang.IllegalArgumentException: Target is this node! -> [0.0.0.0]:8099, response: ErrorResponse{callId=5, urgent=true, cause=java.lang.IllegalArgumentException: Target is this node! -> [0.0.0.0]:8099}`

    Jaromir Hamala
    @jerrinot
    @v8sagar
    0.0.0.0:8099 is super suspicious. can you share your configuration file?