mirror of
https://github.com/open-metadata/OpenMetadata
synced 2026-05-24 09:39:11 +00:00
Fix Entity Promotion issue (#27930)
Some checks failed
Integration Tests - MySQL + Elasticsearch / integration-tests-mysql-elasticsearch (push) Has been cancelled
Integration Tests - PostgreSQL + OpenSearch / integration-tests-postgres-opensearch (push) Has been cancelled
OpenMetadata Service Unit Tests / openmetadata-service-unit-tests (mysql) (push) Has been cancelled
OpenMetadata Service Unit Tests / openmetadata-service-unit-tests (postgresql) (push) Has been cancelled
OpenMetadata Service Unit Tests / k8s_operator-unit-tests (push) Has been cancelled
OpenMetadata Service Unit Tests / openmetadata-service-unit-tests-status (push) Has been cancelled
Integration Tests - MySQL + Elasticsearch / Detect Changes (push) Has been cancelled
Integration Tests - PostgreSQL + OpenSearch / Detect Changes (push) Has been cancelled
Java Checkstyle / java-checkstyle (push) Has been cancelled
Maven Collate Tests / maven-collate-ci (push) Has been cancelled
OpenMetadata Service Unit Tests / Detect Changes (push) Has been cancelled
Publish Package to Maven Central Repository / publish-maven-packages (push) Has been cancelled
Some checks failed
Integration Tests - MySQL + Elasticsearch / integration-tests-mysql-elasticsearch (push) Has been cancelled
Integration Tests - PostgreSQL + OpenSearch / integration-tests-postgres-opensearch (push) Has been cancelled
OpenMetadata Service Unit Tests / openmetadata-service-unit-tests (mysql) (push) Has been cancelled
OpenMetadata Service Unit Tests / openmetadata-service-unit-tests (postgresql) (push) Has been cancelled
OpenMetadata Service Unit Tests / k8s_operator-unit-tests (push) Has been cancelled
OpenMetadata Service Unit Tests / openmetadata-service-unit-tests-status (push) Has been cancelled
Integration Tests - MySQL + Elasticsearch / Detect Changes (push) Has been cancelled
Integration Tests - PostgreSQL + OpenSearch / Detect Changes (push) Has been cancelled
Java Checkstyle / java-checkstyle (push) Has been cancelled
Maven Collate Tests / maven-collate-ci (push) Has been cancelled
OpenMetadata Service Unit Tests / Detect Changes (push) Has been cancelled
Publish Package to Maven Central Repository / publish-maven-packages (push) Has been cancelled
This commit is contained in:
parent
297c01cea7
commit
e56abb80d5
2 changed files with 13 additions and 0 deletions
|
|
@ -1102,6 +1102,13 @@ public class DistributedSearchIndexExecutor {
|
|||
// Set up per-entity promotion callback if recreating indices
|
||||
if (recreateIndex && recreateContext != null) {
|
||||
this.recreateIndexHandler = Entity.getSearchRepository().createReindexHandler();
|
||||
// Wire job configuration so applyLiveServingSettings can revert bulk-build overrides
|
||||
// (refresh=-1, replicas=0, async translog) before the per-entity alias swap.
|
||||
if (recreateIndexHandler instanceof DefaultRecreateHandler defaultHandler
|
||||
&& currentJob != null
|
||||
&& currentJob.getJobConfiguration() != null) {
|
||||
defaultHandler.withJobData(currentJob.getJobConfiguration());
|
||||
}
|
||||
entityTracker.setOnEntityComplete(this::promoteEntityIndex);
|
||||
LOG.info(
|
||||
"Per-entity promotion callback SET for job {} (recreateIndex={}, recreateContext entities={})",
|
||||
|
|
|
|||
|
|
@ -323,6 +323,12 @@ public class DefaultRecreateHandler implements RecreateIndexHandler {
|
|||
|
||||
// Always clear staged-index routing on the way out — see the rationale in finalizeReindex.
|
||||
try {
|
||||
// Restore live serving settings on the staged index before alias swap. The bulk-build
|
||||
// overrides (refresh=-1, replicas=0, async translog) must NOT be the new live settings,
|
||||
// or newly indexed docs are buffered indefinitely until a manual _refresh.
|
||||
applyLiveServingSettings(searchClient, stagedIndex, entityType);
|
||||
maybeForceMerge(searchClient, stagedIndex, entityType);
|
||||
|
||||
Set<String> aliasesToAttach =
|
||||
getAliasesFromMapping(indexMapping, searchRepository.getClusterAlias());
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue