Skip to content
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

[Feature] S3 storage volume support partitioned prefix feature #41627

Merged
merged 1 commit into from Feb 28, 2024

Conversation

kevincai
Copy link
Contributor

@kevincai kevincai commented Feb 26, 2024

  • s3 storage volume added the following two properties to support partitioned prefix feature
    • aws.s3.enable_partitioned_prefix
    • aws.s3.num_partitioned_prefix

Why I'm doing:

What I'm doing:

Fixes #issue

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 3.2
    • 3.1
    • 3.0
    • 2.5

@kevincai kevincai force-pushed the fe-storage-volume-prefix branch 2 times, most recently from 4f249c9 to 95bd643 Compare February 26, 2024 10:52
@sduzh sduzh self-requested a review February 26, 2024 11:10
if (value != null) {
try {
int val = Integer.parseInt(value);
if (val < 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deal with 0

Copy link
Contributor Author

@kevincai kevincai Feb 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 is handled as if the value is not provided, which is in line 96.

this.numOfPartitionedPrefix = val;
}
} catch (NumberFormatException e) {
throw new IllegalArgumentException(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can upper level handle this exception?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it can, refer to the UT.

validateStorageVolumeConstraints();
}

private void validateStorageVolumeConstraints() throws DdlException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems not necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

subpath is not allowed when storage volume is enabled with partitioned prefix, otherwise the meaning of subpath is confusing.

* s3 storage volume added the following two properties to support
  partitioned prefix feature
  - aws.s3.enable_partitioned_prefix
  - aws.s3.num_partitioned_prefix

Signed-off-by: Kevin Xiaohua Cai <caixiaohua@starrocks.com>
Copy link

sonarcloud bot commented Feb 26, 2024

Copy link

[BE Incremental Coverage Report]

pass : 0 / 0 (0%)

Copy link

[FE Incremental Coverage Report]

pass : 74 / 75 (98.67%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 com/starrocks/storagevolume/StorageVolume.java 24 25 96.00% [129]
🔵 com/starrocks/credential/aws/AWSCloudConfiguration.java 25 25 100.00% []
🔵 com/starrocks/catalog/OlapTable.java 1 1 100.00% []
🔵 com/starrocks/server/StorageVolumeMgr.java 22 22 100.00% []
🔵 com/starrocks/lake/StarOSAgent.java 2 2 100.00% []

@@ -164,6 +165,14 @@ public void updateStorageVolume(String name, Map<String, String> params, Optiona
StorageVolume copied = new StorageVolume(sv);
validateParams(copied.getType(), params);

List<String> immutableProperties =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about making immutableProperties as a member of StorageVolumeMgr?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes it can. However, I am thinking about refactor the StorageVolume, derive it by S3StorageVolume/HdfsStorageVolume/AzblobStorageVolume, each storage volume can handle its own immutable properties and validation.

It's beyond this feature, so in this PR, just keep the simplest coding, refactor it in a separate PR.

Smith-Cruise

This comment was marked as outdated.

}

@Override
public String toConfString() {
// TODO: add enable_partitioned_prefix, num_partitioned_prefix output
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why todo, we will use toConfString as map's key.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these two properties are specific for storage volume, won't be used for external table property configuration. So add todo here.

@kevincai
Copy link
Contributor Author

can you explain about aws.s3.enable_partitioned_prefix aws.s3.num_partitioned_prefix

sent you the doc link

@sduzh sduzh enabled auto-merge (squash) February 28, 2024 03:35
@sduzh sduzh disabled auto-merge February 28, 2024 03:35
@nshangyiming nshangyiming merged commit de98d87 into StarRocks:main Feb 28, 2024
70 checks passed
@kevincai
Copy link
Contributor Author

@Mergifyio backport branch-3.2

Copy link
Contributor

mergify bot commented Feb 28, 2024

backport branch-3.2

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Feb 28, 2024
Signed-off-by: Kevin Xiaohua Cai <caixiaohua@starrocks.com>
(cherry picked from commit de98d87)
kevincai added a commit that referenced this pull request Feb 28, 2024
Signed-off-by: Kevin Xiaohua Cai <caixiaohua@starrocks.com>
(cherry picked from commit de98d87)
Signed-off-by: Kevin Xiaohua Cai <caixiaohua@starrocks.com>
wanpengfei-git pushed a commit that referenced this pull request Feb 28, 2024
…ort #41627) (#41821)

Signed-off-by: Kevin Xiaohua Cai <caixiaohua@starrocks.com>
Co-authored-by: Kevin Cai <caixiaohua@starrocks.com>
Seaven pushed a commit to Seaven/starrocks that referenced this pull request Feb 28, 2024
…ocks#41627)

Signed-off-by: Kevin Xiaohua Cai <caixiaohua@starrocks.com>
Signed-off-by: Seaven <seaven_7@qq.com>
@evelynzhaojie
Copy link
Contributor

@kevincai pls notify TW Wanglichen of this change or submit a PR to update the doc

@kevincai kevincai deleted the fe-storage-volume-prefix branch March 5, 2024 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants