We are getting error message “Cannot allocate as_string” when we are trying to write into Aerospike using PHP client library. The strange thing is that this is happening only in few cases (problematic objects have around 60kB). Most of the writes are successfully finished. We are using igbinary serialization but even if we change it to default PHP serialization we are still experiencing the same problem.
Hey, please open this as an issue on the GitHub repo aerospike/aerospike-client-php. If you have sample data that can trigger the bug, that would be great.
We have found the cause of our problem. The situation will occur when the array contains more than 1024 objects. In that case the serialization callback runs for each object separately and obviously there is 1024 limit. So we have implemented workaround when we are serializing the whole array ahead of internal serialization. As the constant AS_MAX_STORE_SIZE is set to 1024 it seems to me that this is a feature not a bug.