david-streamlio opened a new issue, #97:
URL: https://github.com/apache/pulsar-connectors/issues/97

   ## Description
   
   The Aerospike sink fails on **every** record. Found while adding the first 
integration test for the module (#47 / #96) — the module previously had zero 
tests, so this shipped broken.
   
   ## Root cause
   
   `AerospikeAbstractSink.write()` builds the bin from a Java-serialized blob:
   
   ```java
   // AerospikeAbstractSink.java:97
   Bin bin = new Bin(aerospikeSinkConfig.getColumnName(), 
Value.getAsBlob(keyValue.getValue()));
   ```
   
   But the pinned client `com.aerospike:aerospike-client-bc:4.5.0` has Java 
object serialization **compiled out**. Verified from the artifact's bytecode:
   
   ```
   com.aerospike.client.Value$BlobValue.estimateSize():
       new    com/aerospike/client/AerospikeException
       ldc    "Object serializer has been disabled"
       ...throw
   ```
   
   `estimateSize()` is called during `client.put(...)`, so every write throws 
`AerospikeException(-10, "Object serializer has been disabled")`. There is no 
flag to re-enable the serializer in the `-bc` build.
   
   ## Fix
   
   Store the value as a native, first-class bin instead of a serialized blob:
   
   ```java
   Bin bin = new Bin(aerospikeSinkConfig.getColumnName(), 
Value.get(keyValue.getValue()));
   ```
   
   For the string sink this stores a native string bin, which is what a reader 
expects anyway. Since the old code path never succeeded, no existing data 
depends on the blob format — the change is safe.
   
   ## Proposed in #96
   
   #96 (the integration test that found this) currently includes this one-line 
fix so the test can pass. Given the sink is instantiated in-process by the 
test, the fix is unavoidable to get any green test at all. Per the split 
precedent from #78/#79 (DynamoDB), this fix may be worth landing as its own PR 
with #96 rebased on top — noted for maintainer preference.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to