narendly commented on a change in pull request #426: Add BucketDataAccessor for large writes URL: https://github.com/apache/helix/pull/426#discussion_r320828938
########## File path: helix-core/src/main/java/org/apache/helix/manager/zk/ZkBucketDataAccessor.java ########## @@ -87,19 +90,30 @@ public Object deserialize(byte[] data) throws ZkMarshallingError { _zkSerializer = new ZNRecordJacksonSerializer(); _bucketSize = bucketSize; + _numVersions = numVersions; } /** * Constructor that uses a default bucket size. * @param zkAddr */ public ZkBucketDataAccessor(String zkAddr) { - this(zkAddr, DEFAULT_BUCKET_SIZE); + this(zkAddr, DEFAULT_BUCKET_SIZE, DEFAULT_NUM_VERSIONS); } @Override public <T extends HelixProperty> boolean compressedBucketWrite(String path, T value) throws IOException { + lock(path); Review comment: Moved the first part of the bucket size calculation before the lock. It's not possible to do it all before because we need to read the metadata. And we want to lock before reading the metadata to avoid race conditions around metadata. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@helix.apache.org For additional commands, e-mail: reviews-h...@helix.apache.org