Replica.MASTER_PROLES on batch read

CE Version : 4.3.0.10 4 nodes cluster RF=2

We are facing high connections issue on a node. During debug, we suspect its due to hot keys on the box while doing batch read. We plan to increase RF & use Replica.MASTER_PROLES policy for the batch read.

public Record[] batchGet(Key[] keys) {
        BatchPolicy batchPolicy = new BatchPolicy();
        batchPolicy.replica = Replica.MASTER_PROLES;
        batchPolicy.maxConcurrentThreads = 0;
        return aerospikeClient.get(batchPolicy, keys);
    }

Yes, MASTER_PROLES policy will distribute the batch workload over the replicas. Is this what you are asking?

Thanks for your reply. As you said, this is what we want ie to avoid batch read calls traffic going only to corresponding master copy node but to also distribute over replica nodes. Just when we started to code to use MASTER_PROLES, in comments section of the java client code, we found Batch calls are not affected by replica algorithms. Can you clarify if MASTER_PROLES will work for our batch read calls? Can we ignore this comment?

/**

  • Replica algorithm used to determine the target node for a single record command.
  • Batch, scan and query are not affected by replica algorithms.
  • Default: {@link Replica#SEQUENCE} */ public Replica replica = Replica.SEQUENCE;

That javadoc comment is no longer correct. Batch was changed to respect replica. This doc will be fixed in the next release.

Thanks Brian. Which java client version supports batch policy respecting replica (MASTER_PROLES )?

Client version >= 4.4.0.

© 2015 Copyright Aerospike, Inc. | All rights reserved. Creators of the Aerospike Database.