Skip to content

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Dec 27, 2025

Why I'm doing:

According to this, the syntax is

ALTER STORAGE VOLUME [ IF EXISTS ] <storage_volume_name>
{ COMMENT = '<comment_string>'
| SET ("key" = "value"[,...]) }

But doesn't support IF EXISTS.

What I'm doing:

Fixes syntax to add IF EXISTS.

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
    • 4.0
    • 3.5
    • 3.4
    • 3.3

Note

Implements IF EXISTS for ALTER STORAGE VOLUME and aligns not-found behavior across layers.

  • Grammar: allow ALTER STORAGE VOLUME (IF EXISTS)? ...; AstBuilder passes the flag; AlterStorageVolumeStmt stores ifExists.
  • Executor: visitAlterStorageVolumeStatement ignores MetaNotFoundException when IF EXISTS is set.
  • Manager: StorageVolumeMgr.updateStorageVolume(...) now throws MetaNotFoundException if the volume is missing; signature updated and immutable-property checks preserved.
  • Tests: updated unit tests to expect MetaNotFoundException; added SQL tests for ALTER STORAGE VOLUME IF EXISTS behavior.

Written by Cursor Bugbot for commit 487193f. This will update automatically on new commits. Configure here.


This is an automatic backport of pull request #66691 done by [Mergify](https://mergify.com).

## Why I'm doing:
According to [this](https://docs.starrocks.io/docs/sql-reference/sql-statements/cluster-management/storage_volume/ALTER_STORAGE_VOLUME/), the syntax is
```sql
ALTER STORAGE VOLUME [ IF EXISTS ] <storage_volume_name>
{ COMMENT = '<comment_string>'
| SET ("key" = "value"[,...]) }
```

But doesn't support `IF EXISTS`.

## What I'm doing:

Fixes syntax to add `IF EXISTS`.

Signed-off-by: Dan-J-D <[email protected]>
Co-authored-by: Kevin Cai <[email protected]>
(cherry picked from commit bf73f06)

# Conflicts:
#	fe/fe-core/src/main/java/com/starrocks/sql/ast/AlterStorageVolumeStmt.java
#	fe/fe-core/src/test/java/com/starrocks/qe/RedirectStatusTest.java
@mergify
Copy link
Contributor Author

mergify bot commented Dec 27, 2025

Cherry-pick of bf73f06 has failed:

On branch mergify/bp/branch-4.0/pr-66691
Your branch is up to date with 'origin/branch-4.0'.

You are currently cherry-picking commit bf73f06fdc.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   fe/fe-core/src/main/java/com/starrocks/qe/DDLStmtExecutor.java
	modified:   fe/fe-core/src/main/java/com/starrocks/server/StorageVolumeMgr.java
	modified:   fe/fe-core/src/main/java/com/starrocks/sql/parser/AstBuilder.java
	modified:   fe/fe-core/src/main/java/com/starrocks/sql/parser/StarRocks.g4
	modified:   fe/fe-core/src/test/java/com/starrocks/server/SharedDataStorageVolumeMgrTest.java
	modified:   fe/fe-core/src/test/java/com/starrocks/server/SharedNothingStorageVolumeMgrTest.java
	modified:   test/sql/test_storage_volume/R/alter_storage_volume
	modified:   test/sql/test_storage_volume/T/alter_storage_volume

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	both modified:   fe/fe-core/src/main/java/com/starrocks/sql/ast/AlterStorageVolumeStmt.java
	deleted by us:   fe/fe-core/src/test/java/com/starrocks/qe/RedirectStatusTest.java

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@mergify mergify bot added the conflicts label Dec 27, 2025
@wanpengfei-git wanpengfei-git enabled auto-merge (squash) December 27, 2025 18:24
@mergify mergify bot closed this Dec 27, 2025
auto-merge was automatically disabled December 27, 2025 18:24

Pull request was closed

@mergify
Copy link
Contributor Author

mergify bot commented Dec 27, 2025

@mergify[bot]: Backport conflict, please reslove the conflict and resubmit the pr

@mergify
Copy link
Contributor Author

mergify bot commented Dec 27, 2025

🧪 CI Insights

Here's what we observed from your CI run for 03cf2d2.

❌ Job Failures

Pipeline Job Health on branch-4.0 Retries 🔍 CI Insights 📄 Logs
PR CHECKER automerge-check Unknown 0 View View

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.

2 participants