mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-17 13:45:54 +00:00
fix(elasticsearch): fix orphan index clean up pattern, consistent top… (#7242)
This commit is contained in:
parent
d2bcdc301a
commit
d557fd65ff
@ -56,7 +56,7 @@ ENV METADATA_CHANGE_LOG_TIMESERIES_TOPIC_NAME="MetadataChangeLog_Timeseries_v1"
|
||||
ENV METADATA_CHANGE_PROPOSAL_TOPIC_NAME="MetadataChangeProposal_v1"
|
||||
ENV FAILED_METADATA_CHANGE_PROPOSAL_TOPIC_NAME="FailedMetadataChangeProposal_v1"
|
||||
ENV PLATFORM_EVENT_TOPIC_NAME="PlatformEvent_v1"
|
||||
ENV DATAHUB_UPGRADE_HISTORY_TOPIC="DataHubUpgradeHistory_v1"
|
||||
ENV DATAHUB_UPGRADE_HISTORY_TOPIC_NAME="DataHubUpgradeHistory_v1"
|
||||
|
||||
COPY docker/kafka-setup/kafka-setup.sh ./kafka-setup.sh
|
||||
COPY docker/kafka-setup/kafka-config.sh ./kafka-config.sh
|
||||
|
2
docker/kafka-setup/env/docker.env
vendored
2
docker/kafka-setup/env/docker.env
vendored
@ -15,7 +15,7 @@ KAFKA_BOOTSTRAP_SERVER=broker:29092
|
||||
# FAILED_METADATA_CHANGE_EVENT_NAME=FailedMetadataChangeEvent_v4
|
||||
# PLATFORM_EVENT_TOPIC_NAME=PlatformEvent_v1
|
||||
# DATAHUB_USAGE_EVENT_NAME=DataHubUsageEvent_v1
|
||||
# DATAHUB_UPGRADE_HISTORY_TOPIC=DataHubUpgradeHistory_v1
|
||||
# DATAHUB_UPGRADE_HISTORY_TOPIC_NAME=DataHubUpgradeHistory_v1
|
||||
# PARTITIONS=1
|
||||
# REPLICATION_FACTOR=1
|
||||
|
||||
|
@ -116,7 +116,7 @@ send "$FAILED_METADATA_CHANGE_PROPOSAL_TOPIC_NAME" "--topic $FAILED_METADATA_CHA
|
||||
send "$PLATFORM_EVENT_TOPIC_NAME" "--topic $PLATFORM_EVENT_TOPIC_NAME"
|
||||
|
||||
# Infinite retention upgrade topic
|
||||
send "$DATAHUB_UPGRADE_HISTORY_TOPIC" "config retention.ms=-1 --topic $DATAHUB_UPGRADE_HISTORY_TOPIC"
|
||||
send "$DATAHUB_UPGRADE_HISTORY_TOPIC_NAME" "config retention.ms=-1 --topic $DATAHUB_UPGRADE_HISTORY_TOPIC_NAME"
|
||||
# Create topic for datahub usage event
|
||||
if [[ $DATAHUB_ANALYTICS_ENABLED == true ]]; then
|
||||
send "$DATAHUB_USAGE_EVENT_NAME" "--topic $DATAHUB_USAGE_EVENT_NAME"
|
||||
|
@ -439,7 +439,7 @@ public class ESIndexBuilder {
|
||||
.minus(Duration.of(esConfig.getBuildIndices().getRetentionValue(),
|
||||
ChronoUnit.valueOf(esConfig.getBuildIndices().getRetentionUnit()))));
|
||||
|
||||
GetIndexResponse response = searchClient.indices().get(new GetIndexRequest(indexState.indexPattern()), RequestOptions.DEFAULT);
|
||||
GetIndexResponse response = searchClient.indices().get(new GetIndexRequest(indexState.indexCleanPattern()), RequestOptions.DEFAULT);
|
||||
|
||||
for (String index : response.getIndices()) {
|
||||
var creationDateStr = response.getSetting(index, "index.creation_date");
|
||||
@ -456,7 +456,7 @@ public class ESIndexBuilder {
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.info("Failed to get orphaned indices with pattern {}: Exception {}", indexState.indexPattern(), e.toString());
|
||||
log.info("Failed to get orphaned indices with pattern {}: Exception {}", indexState.indexCleanPattern(), e.toString());
|
||||
}
|
||||
return orphanedIndices;
|
||||
}
|
||||
|
@ -103,6 +103,10 @@ public class ReindexConfig {
|
||||
return name + "*";
|
||||
}
|
||||
|
||||
public String indexCleanPattern() {
|
||||
return name + "_*";
|
||||
}
|
||||
|
||||
private static class CalculatedBuilder extends ReindexConfigBuilder {
|
||||
@Override
|
||||
public ReindexConfig build() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user