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] Support only deleting shard meta from fe for shared-data cluster #53141

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions fe/fe-core/src/main/java/com/starrocks/common/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -2538,6 +2538,9 @@ public class Config extends ConfigBase {
@ConfField(mutable = true)
public static boolean meta_sync_force_delete_shard_meta = false;

@ConfField(mutable = true)
public static boolean meta_sync_delete_shard_meta_in_fe_only = false;

// ***********************************************************
// * BEGIN: Cloud native meta server related configurations
// ***********************************************************
Expand Down
11 changes: 11 additions & 0 deletions fe/fe-core/src/main/java/com/starrocks/lake/StarMgrMetaSyncer.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,17 @@ private List<Long> getAllPartitionShardGroupId() {
}

public static void dropTabletAndDeleteShard(List<Long> shardIds, StarOSAgent starOSAgent) {
if (Config.meta_sync_delete_shard_meta_in_fe_only) {
// delete shard from star manager only, not considering tablet data on be/cn
try {
if (!shardIds.isEmpty()) {
starOSAgent.deleteShards(new HashSet<>(shardIds));
}
} catch (DdlException e) {
LOG.warn("failed to delete shards from starMgr");
}
return;
}
Preconditions.checkNotNull(starOSAgent);
Map<Long, Set<Long>> shardIdsByBeMap = new HashMap<>();
// group shards by be
Expand Down
Loading