-
Notifications
You must be signed in to change notification settings - Fork 2.4k
[HUDI-9159] S3 implementation of StorageLock for StorageBasedLockProvider #13126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…lient/transaction/lock/ConditionalWriteLockConfig.java Co-authored-by: Y Ethan Guo <[email protected]>
…lient/transaction/lock/ConditionalWriteLockConfig.java Co-authored-by: Y Ethan Guo <[email protected]>
…lient/transaction/lock/ConditionalWriteLockConfig.java Co-authored-by: Y Ethan Guo <[email protected]>
…lient/transaction/lock/ConditionalWriteLockConfig.java Co-authored-by: Y Ethan Guo <[email protected]>
…lient/transaction/lock/ConditionalWriteLockProvider.java Co-authored-by: Y Ethan Guo <[email protected]>
…lient/transaction/lock/ConditionalWriteLockProvider.java Co-authored-by: Y Ethan Guo <[email protected]>
…lient/transaction/lock/ConditionalWriteLockProvider.java Co-authored-by: Y Ethan Guo <[email protected]>
Co-authored-by: Y Ethan Guo <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed the S3StorageLockClient
hudi-aws/src/main/java/org/apache/hudi/aws/transaction/lock/S3StorageLockClient.java
Outdated
Show resolved
Hide resolved
hudi-aws/src/main/java/org/apache/hudi/aws/transaction/lock/S3StorageLockClient.java
Outdated
Show resolved
Hide resolved
hudi-aws/src/main/java/org/apache/hudi/aws/transaction/lock/S3StorageLockClient.java
Outdated
Show resolved
Hide resolved
hudi-aws/src/main/java/org/apache/hudi/aws/transaction/lock/S3StorageLockClient.java
Outdated
Show resolved
Hide resolved
hudi-aws/src/main/java/org/apache/hudi/aws/transaction/lock/S3StorageLockClient.java
Outdated
Show resolved
Hide resolved
hudi-aws/src/main/java/org/apache/hudi/aws/transaction/lock/S3StorageLockClient.java
Outdated
Show resolved
Hide resolved
hudi-aws/src/main/java/org/apache/hudi/aws/transaction/lock/S3StorageLockClient.java
Outdated
Show resolved
Hide resolved
* Tests S3-based StorageBasedLockProvider using a LocalStack container | ||
* to emulate S3. | ||
*/ | ||
@Disabled("HUDI-9159 The tests do not work. Disabling them to unblock Azure CI") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there plan to make this work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we mock s3 behavior. Looks like you are trying to functional test using localstack
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah we mock the s3 behavior with TestS3StorageLockClient. Localstack doesn't seem to work in Azure CI, same issue as other tests Davis disabled a while back
hudi-aws/src/test/java/org/apache/hudi/aws/transaction/lock/TestS3StorageLockClient.java
Show resolved
Hide resolved
can you update the PR desc as to what tests we have done so far in cluster w/ this patch? |
13b4575
to
d218f8f
Compare
btw, lets remove the retries within renew method. I see we do synchronized across renew method and close(). so, there are chances that close() starves, when renew() is sleeping. so, lets remove the retries within renew method(or tryCreateOrUpdateLockFile) in let heart beat manager do the retry after 30 secs. |
Few more feedback that needs to be addressed:
|
hudi-aws/src/main/java/org/apache/hudi/aws/transaction/lock/S3StorageLockClient.java
Show resolved
Hide resolved
hudi-aws/src/main/java/org/apache/hudi/aws/transaction/lock/S3StorageLockClient.java
Show resolved
Hide resolved
...t-common/src/main/java/org/apache/hudi/client/transaction/lock/StorageBasedLockProvider.java
Outdated
Show resolved
Hide resolved
...t-common/src/main/java/org/apache/hudi/client/transaction/lock/StorageBasedLockProvider.java
Outdated
Show resolved
Hide resolved
...t-common/src/main/java/org/apache/hudi/client/transaction/lock/StorageBasedLockProvider.java
Show resolved
Hide resolved
hudi-aws/src/main/java/org/apache/hudi/aws/transaction/lock/S3StorageLockClient.java
Outdated
Show resolved
Hide resolved
@hudi-bot run azure |
1 similar comment
@hudi-bot run azure |
hudi-aws/src/main/java/org/apache/hudi/aws/transaction/lock/S3StorageLockClient.java
Outdated
Show resolved
Hide resolved
hudi-aws/src/main/java/org/apache/hudi/aws/transaction/lock/S3StorageLockClient.java
Outdated
Show resolved
Hide resolved
hudi-aws/src/main/java/org/apache/hudi/aws/transaction/lock/S3StorageLockClient.java
Outdated
Show resolved
Hide resolved
hudi-aws/src/main/java/org/apache/hudi/aws/transaction/lock/S3StorageLockClient.java
Outdated
Show resolved
Hide resolved
...t-common/src/main/java/org/apache/hudi/client/transaction/lock/StorageBasedLockProvider.java
Outdated
Show resolved
Hide resolved
...t-common/src/main/java/org/apache/hudi/client/transaction/lock/StorageBasedLockProvider.java
Show resolved
Hide resolved
hudi-aws/src/main/java/org/apache/hudi/aws/transaction/lock/S3StorageLockClient.java
Outdated
Show resolved
Hide resolved
...t-common/src/main/java/org/apache/hudi/client/transaction/lock/StorageBasedLockProvider.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for patiently addressing all feedback Alex.
@@ -83,13 +83,13 @@ private void checkRequiredProps() { | |||
throw new IllegalArgumentException(BASE_PATH.key() + notExistsMsg); | |||
} | |||
if (lockConfig.getLongOrDefault(VALIDITY_TIMEOUT_SECONDS) < lockConfig.getLongOrDefault(HEARTBEAT_POLL_SECONDS) | |||
* 3) { | |||
* 10) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you get any more feedback from danny or someone before we land this patch, can you also fix L 35 var name to LOCK_VALIDITY_TIMEOUT_SECS along w/ addressing them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually @yihua suggested VALIDITY_TIMEOUT_SECONDS
in an earlier PR it used to be LOCK_VALIDITY_TIMEOUT_MS
@danny0405 : Do you wanna review this patch |
} catch (S3Exception e) { | ||
int status = e.statusCode(); | ||
// Default to unknown error | ||
LockGetResult result = LockGetResult.UNKNOWN_ERROR; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename handleUpsertS3Exception
to handleS3Exception
and reuse it here?
// How long to wait before retrying lock acquisition in blocking calls. | ||
private static final long DEFAULT_LOCK_ACQUISITION_BUFFER_MS = 1000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete the comment in line 76 too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, fine with it, just some minor comments.
…ider (apache#13126) * Adds the storage based lock provider implementation for s3 hudi tables. --------- Co-authored-by: Y Ethan Guo <[email protected]> Co-authored-by: sivabalan <[email protected]> (cherry picked from commit ed1ef93)
Change Logs
Adds the storage based lock provider implementation for s3 hudi tables.
Impact
Allows conditional writes based locking for multi writer scenarios with hudi tables in s3.
Risk level (write none, low medium or high below)
None
Documentation Update
None
Contributor's checklist
In order to test this we setup local hudi/spark bundles and ran some concurrent spark sql queries to tables with this LP enabled to ensure things functioned as expected.