HDDS-10832. Client should switch to streaming based on OpenKeySession replication #6683
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Current client workflow:
createKey
orcreateStreamKey
, or similar methods)Streaming write is supported only for Ratis-based replication. However, actual replication may be decided by OM based on its own config, if there aren't any more specific settings (coming from client, or configured at bucket level).
If client chooses streaming write and OM ends up creating an EC key, client may run into errors when trying to use output streams in step 4.
This change fixes that by allowing the client to fall back to regular write instead of streaming in this case. It is achieved by checking the replication type of the open key received from OM when setting up the streams in step 3.
https://issues.apache.org/jira/browse/HDDS-10832
How was this patch tested?
Updated
TestOzoneRpcClientWithRatis
to test streaming multipart upload with different replication types (which client sets explicitly in its request for simplicity).Tested original repro steps (as described in HDDS-10832):
docker-compose.yaml
:CI:
https://github.com/adoroszlai/ozone/actions/runs/9098024548