aerospike / aerospike-client-python

Aerospike Python Client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Max records for a batch_write call is less than server's default

nkonopinski opened this issue · comments

The default server batch-max-requests size is 5k but this client's max appears to be 4096 set here:
https://github.com/aerospike/aerospike-client-python/blob/master/src/include/pool.h#L12

When I attempt to construct a batch larger than 4096 keys/records, I get 'Cannot allocate as_bytes'

records = br.BatchRecords(
    [br.Write(
        key=(myNamespace, mySet, myKey),
        ops=[op.write('', bytearray(value))],
     ) for key, value in items.items()
     ]
)
try:
    client.batch_write(records)
except (ex.AerospikeError, ex.ClientError, ex.ServerError) as e:
    log.error("Aerospike batch_write error: [{0}] {1}".format(e.code, e.msg))

Am I creating the batch incorrectly? Is there a way to get around the limitation without limiting batch_write() to 4096 records?