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] Fix partition live number not register #34842

Merged
merged 14 commits into from
Nov 16, 2023
Next Next commit
Fix partition live number not register
Signed-off-by: Astralidea <astralidea@163.com>
  • Loading branch information
Astralidea committed Nov 13, 2023
commit 9708e3b64b43a62b1a93808e5a74a728af35594d
Original file line number Diff line number Diff line change
Expand Up @@ -3984,7 +3984,7 @@ public void modifyTableDynamicPartition(Database db, OlapTable table, Map<String
public void alterTableProperties(Database db, OlapTable table, Map<String, String> properties)
throws DdlException {
Map<String, String> logProperties = new HashMap<>(properties);
int partitionLiveNumber = -1;
int partitionLiveNumber = TableProperty.INVALID;
if (properties.containsKey(PropertyAnalyzer.PROPERTIES_PARTITION_LIVE_NUMBER)) {
try {
partitionLiveNumber = PropertyAnalyzer.analyzePartitionLiveNumber(properties, true);
Expand Down Expand Up @@ -4014,6 +4014,13 @@ public void alterTableProperties(Database db, OlapTable table, Map<String, Strin
if (logProperties.containsKey(PropertyAnalyzer.PROPERTIES_PARTITION_LIVE_NUMBER)) {
tableProperty.getProperties().put(PropertyAnalyzer.PROPERTIES_PARTITION_LIVE_NUMBER,
String.valueOf(partitionLiveNumber));
if (partitionLiveNumber == TableProperty.INVALID) {
GlobalStateMgr.getCurrentState().getDynamicPartitionScheduler().removeTtlPartitionTable(db.getId(),
table.getId());
} else {
GlobalStateMgr.getCurrentState().getDynamicPartitionScheduler().registerTtlPartitionTable(db.getId(),
table.getId());
}
tableProperty.setPartitionTTLNumber(partitionLiveNumber);
} else if (logProperties.containsKey(PropertyAnalyzer.PROPERTIES_STORAGE_MEDIUM)) {
TStorageMedium storageMedium = dataProperty.getStorageMedium();
Expand Down