Skip to content

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

@nkonopinski

Description

@nkonopinski

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions