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

[BugFix] Publish version operation should be successful even if the warehouse is not exist #52967

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

yandongxiao
Copy link
Contributor

Why I'm doing:

Publish version operation should be successful even if the warehouse is not exist

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.3
    • 3.2
    • 3.1
    • 3.0
    • 2.5

@yandongxiao yandongxiao force-pushed the bugfix/publish-version-should-be-successful-2 branch from 3043d02 to e91a9ce Compare November 18, 2024 06:02

// publish version operation should be successful even if the warehouse is not exist
if (!GlobalStateMgr.getCurrentState().getWarehouseMgr().warehouseExists(warehouseId)) {
warehouseId = WarehouseManager.DEFAULT_WAREHOUSE_ID;
Copy link
Contributor

Choose a reason for hiding this comment

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

log a message to this situation. ideally this should not happen.

Also need to consider another situation where the warehouse exists but there is no compute node in the warehouse, what to do then?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In this situation, FE will fail, and user can solve this problem by add compute node.

But If the warehouse is deleted, the new created warehouse with the same name will have a different warehouse ID.

Copy link
Contributor

Choose a reason for hiding this comment

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

why bother user to add nodes into warehouse, can we move one step forward, choose nodes in other warehouse until there is no warehouse to choose to accomplish this task and then report failure to the end user?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Have logged a message to this situation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently, we have assumed that nodes exist in the default warehouse. As for the logic of selecting other warehouses, I think it needs to be done after removing the reliance on the default warehouse. Currently, other parts of the code also use the default warehouse as a backup.

Copy link
Contributor

@kevincai kevincai Nov 18, 2024

Choose a reason for hiding this comment

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

what if there is not possible to fix it in short time. Failing the ops in the beginning if possible but not in the last step. this publish txn can't be cancelled and will block all the subsequent operations in the queue.

Copy link
Contributor

Choose a reason for hiding this comment

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

It is purely valid to have a warehouse but with no node. There is no such restriction that a warehouse must have nodes. If the situation can be solved with less assumption and it is reasonable to remove the assumption, then we should go without the assumption.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what if there is not possible to fix it in short time. Failing the ops in the beginning if possible but not in the last step. this publish txn can't be cancelled and will block all the subsequent operations in the queue.

For public version operations, if no Node exists, it is reasonable to select the Node in the Default Warehouse.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is purely valid to have a warehouse but with no node. There is no such restriction that a warehouse must have nodes. If the situation can be solved with less assumption and it is reasonable to remove the assumption, then we should go without the assumption.

I think we can totally fix this in another PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Forgot to use background warehouse, and I have fixed to use this warehouse.
And I also fix the situation where no alive node in user's warehouse.

Signed-off-by: yandongxiao <[email protected]>
Copy link

sonarcloud bot commented Nov 18, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
75.7% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Copy link
Contributor

@kevincai kevincai left a comment

Choose a reason for hiding this comment

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

--comment removed--

Copy link

[Java-Extensions Incremental Coverage Report]

pass : 0 / 0 (0%)

Copy link

[FE Incremental Coverage Report]

fail : 5 / 22 (22.73%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 com/starrocks/lake/Utils.java 3 20 15.00% [119, 120, 121, 127, 128, 130, 131, 192, 193, 194, 195, 196, 200, 202, 203, 205, 206]
🔵 com/starrocks/server/WarehouseManager.java 2 2 100.00% []

Copy link

[BE Incremental Coverage Report]

pass : 0 / 0 (0%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants