mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-12-13 00:22:23 +00:00
Fix document missing exception for ES/OS update entity (#24562)
This commit is contained in:
parent
8ad2760d11
commit
fccd717fbd
@ -361,6 +361,7 @@ public class ElasticSearchEntityManager implements EntityManagementClient {
|
||||
.id(docId)
|
||||
.refresh(Refresh.True)
|
||||
.scriptedUpsert(true)
|
||||
.upsert(params)
|
||||
.script(
|
||||
s ->
|
||||
s.inline(
|
||||
@ -375,7 +376,20 @@ public class ElasticSearchEntityManager implements EntityManagementClient {
|
||||
"Successfully updated entity in ElasticSearch for index: {}, docId: {}",
|
||||
indexName,
|
||||
docId);
|
||||
} catch (IOException | ElasticsearchException e) {
|
||||
} catch (ElasticsearchException e) {
|
||||
if (e.status() == 404) {
|
||||
LOG.warn(
|
||||
"Document not found during update for index: {}, docId: {}. The document may not have been indexed yet.",
|
||||
indexName,
|
||||
docId);
|
||||
} else {
|
||||
LOG.error(
|
||||
"Failed to update entity in ElasticSearch for index: {}, docId: {}",
|
||||
indexName,
|
||||
docId,
|
||||
e);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
LOG.error(
|
||||
"Failed to update entity in ElasticSearch for index: {}, docId: {}", indexName, docId, e);
|
||||
}
|
||||
|
||||
@ -369,6 +369,7 @@ public class OpenSearchEntityManager implements EntityManagementClient {
|
||||
.id(docId)
|
||||
.refresh(Refresh.True)
|
||||
.scriptedUpsert(true)
|
||||
.upsert(params)
|
||||
.script(
|
||||
s ->
|
||||
s.inline(
|
||||
@ -381,7 +382,17 @@ public class OpenSearchEntityManager implements EntityManagementClient {
|
||||
|
||||
LOG.info(
|
||||
"Successfully updated entity in OpenSearch for index: {}, docId: {}", indexName, docId);
|
||||
} catch (IOException | OpenSearchException e) {
|
||||
} catch (OpenSearchException e) {
|
||||
if (e.status() == 404) {
|
||||
LOG.warn(
|
||||
"Document not found during update for index: {}, docId: {}. The document may not have been indexed yet.",
|
||||
indexName,
|
||||
docId);
|
||||
} else {
|
||||
LOG.error(
|
||||
"Failed to update entity in OpenSearch for index: {}, docId: {}", indexName, docId, e);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
LOG.error(
|
||||
"Failed to update entity in OpenSearch for index: {}, docId: {}", indexName, docId, e);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user