-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Enhancement] Delete garbage data throught recycle bin after truncate table in share data mode #49975
Conversation
try { | ||
GlobalStateMgr.getCurrentState().getRecycleBin().erasePartition(Long.MAX_VALUE); | ||
} catch (Exception ignore) { | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try { | |
GlobalStateMgr.getCurrentState().getRecycleBin().erasePartition(Long.MAX_VALUE); | |
} catch (Exception ignore) { | |
} | |
ExceptionChecker.expectThrowsNoException(() -> GlobalStateMgr.getCurrentState().getRecycleBin().erasePartition(Long.MAX_VALUE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
@@ -902,6 +902,11 @@ protected void runAfterCatalogReady() { | |||
} | |||
} | |||
|
|||
@VisibleForTesting | |||
public synchronized boolean isContainedInidToRecycleTime(long id) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public synchronized boolean isContainedInidToRecycleTime(long id) { | |
synchronized boolean isContainedInidToRecycleTime(long id) { |
remove the access identifier, so the interface can be accessible from the same package, but not visible outside the package, which can be a workaround to allow UT accessing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
// For cloud native table, add partition into recycle Bin after truncate table. | ||
// It is no necessary for share nothing mode because file will be deleted throught | ||
// tablet report in this case. | ||
if (this.isCloudNativeTable()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shall be applicable to shared-data materialized view as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
new Expectations() { | ||
{ | ||
GlobalStateMgr.getCurrentState().getWarehouseMgr(); | ||
minTimes = 0; | ||
result = warehouseManager; | ||
} | ||
}; | ||
|
||
new MockUp<GlobalStateMgr>() { | ||
@Mock | ||
public StarOSAgent getStarOSAgent() { | ||
return starOSAgent; | ||
} | ||
}; | ||
|
||
new MockUp<StarOSAgent>() { | ||
@Mock | ||
public ShardInfo getShardInfo(long shardId, long workerGroupId) throws StarClientException { | ||
return shardInfo; | ||
} | ||
}; | ||
|
||
new MockUp<WarehouseManager>() { | ||
@Mock | ||
public Warehouse getBackgroundWarehouse() { | ||
return new DefaultWarehouse(WarehouseManager.DEFAULT_WAREHOUSE_ID, WarehouseManager.DEFAULT_WAREHOUSE_NAME); | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check if possible set these common expectations in a function and call the function to set MockUp/Expectations repeatedly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
… table in share data mode Using recycle bin to delete file after truncate table which is more faster than using StarMgrMetaSyncer Signed-off-by: srlch <[email protected]>
Signed-off-by: srlch <[email protected]>
8280ce1
to
b22047c
Compare
Signed-off-by: srlch <[email protected]>
Quality Gate passedIssues Measures |
[Java-Extensions Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[FE Incremental Coverage Report]✅ pass : 5 / 5 (100.00%) file detail
|
[BE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
@Mergifyio backport branch-3.3 |
✅ Backports have been created
|
… table in share data mode (#49975) Signed-off-by: srlch <[email protected]> (cherry picked from commit 5c03743)
… table in share data mode (backport #49975) (#50418) Co-authored-by: srlch <[email protected]>
… table in share data mode (backport StarRocks#49975) (StarRocks#50418) Co-authored-by: srlch <[email protected]>
… table in share data mode (StarRocks#49975) Signed-off-by: srlch <[email protected]>
… table in share data mode (StarRocks#49975) Signed-off-by: srlch <[email protected]> Signed-off-by: zhiminr.ren <[email protected]>
Using recycle bin to delete file after truncate table which is more faster than using StarMgrMetaSyncer
Why I'm doing:
What I'm doing:
Fixes #issue
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: