HDDS-9388. OM Ratis Write: Move ACL check and Bucket resolution to preExecute#5694
HDDS-9388. OM Ratis Write: Move ACL check and Bucket resolution to preExecute#5694smengcl merged 18 commits intoapache:masterfrom
Conversation
|
Thanks @duongkame for the patch. Failure in |
adoroszlai
left a comment
There was a problem hiding this comment.
There are calls to checkKeyAcls from some validateAndUpdateCache methods, so far I've found:
- OMKeyRenameRequestWithFSO
- S3MultipartUploadCompleteRequest
- OMRecoverLeaseRequest
The first two also resolve bucket links.
Are these intentional?
They're not intentional. I was still cleaning up a few places. Thanks for the detailed look, @adoroszlai . |
|
There's an open point from this PR. Some S3 APIs like MultipartInfoInitiate or MultipartUploadComplete return unnecessary/redundant data like original volume, bucket and key names in their response. With the refactor to move bucket resolution to |
sumitagrawl
left a comment
There was a problem hiding this comment.
@duongkame Thanks for working over this, this changes may have issue,
in pre-execute, it can not validate the relational things which may be part of previous request as,
- link bucket validation as link bucket may not be created and pending to be excuted
- ACL validation as acl change may be pending to be executed
Only static validation related to request can be done, Or some thing from system perspective which normally do not depend on previous possible request
Concurrent requests can be interleaved in any order. I am not sure this is an issue. Do you have a specific issue in mind? |
|
@sumitagrawl I think you are also describing what I wrote on the Jira here. IMO this is more of a minor change in behavior than an issue. The server is still failing the request based on an ordering either way. |
@errose28
|
@sumitagrawl Yes, there are changes in behaviors the edge cases but they're not necessarily issues. The same story for moving ACL checks, as @errose28 mentioned. I think moving validation/pre-processing out of applyTransaction is the right direction. ApplyTransaction should be to apply the state of a request to the state machine. C.c. some more folks as I need your opinions too. @kerneltime @szetszwo @smengcl. |
...p-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyRequest.java
Outdated
Show resolved
Hide resolved
...ager/src/test/java/org/apache/hadoop/ozone/om/request/key/TestOMKeyRenameRequestWithFSO.java
Show resolved
Hide resolved
smengcl
left a comment
There was a problem hiding this comment.
Core change lgtm. Thanks @duongkame for this
…ne/om/request/key/OMKeyRequest.java Co-authored-by: Siyao Meng <50227127+smengcl@users.noreply.github.com>
|
Thanks @duongkame for the patch, and @adoroszlai @sumitagrawl @kerneltime @errose28 for the reviews and comments. |
|
Thanks @smengcl for the reviews and merging it. |
| generateRequiredEncryptionInfo(keyArgs, newKeyArgs, ozoneManager); | ||
| CreateFileRequest.Builder newCreateFileRequest = | ||
| createFileRequest.toBuilder().setKeyArgs(newKeyArgs) | ||
| createFileRequest.toBuilder().setKeyArgs(resolvedArgs) |
There was a problem hiding this comment.
Turns out this causes a regression where encrypted buckets won't correctly have file encryption info in keyargs set. Because encryption info is generated in generateRequiredEncryptionInfo above and put into newKeyArgs.
Credit to @jojochuang for locating this bug.
…lution to preExecute (apache#5694) Change-Id: Ib4b9f7ec9c0320342485f20405197a1b05e61333 Conflicts: hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneClientMultipartUploadWithFSO.java hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneRpcClientAbstract.java hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneRpcClientWithRatis.java hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMAllocateBlockRequest.java hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCommitRequestWithFSO.java hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCreateRequestWithFSO.java hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyDeleteRequestWithFSO.java hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyRenameRequest.java hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyRenameRequestWithFSO.java hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyRequest.java hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/s3/multipart/S3InitiateMultipartUploadRequest.java hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/s3/multipart/S3InitiateMultipartUploadRequestWithFSO.java hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/s3/multipart/S3MultipartUploadAbortRequest.java hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/s3/multipart/S3MultipartUploadCommitPartRequest.java hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/s3/multipart/S3MultipartUploadCompleteRequest.java hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/file/TestOMDirectoryCreateRequest.java hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/file/TestOMDirectoryCreateRequestWithFSO.java hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/key/TestOMKeyDeleteRequest.java hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/key/TestOMKeyDeleteRequestWithFSO.java hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/key/TestOMKeyRenameRequestWithFSO.java hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/response/TestCleanupTableInfo.java Change-Id: I807c3d08ff63a6ec21023f4dd65ad4801e27e6e7
What changes were proposed in this pull request?
ACL checks and bucket soft-link resolution should be moved to preExecute. Today, these checks are done in validateAndUpdateCache and performed in each replica. Those should be done when the leader node receives the operation. Checks should be validated upfront, not when applying the state.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-9388
How was this patch tested?
CI.