Skip to content

[8.17] [Obs AI Assistant] Use update-by-query for semantic_text migration (#220255)#220642

Merged
sorenlouv merged 6 commits intoelastic:8.17from
sorenlouv:backport/8.17/pr-220255
May 14, 2025
Merged

[8.17] [Obs AI Assistant] Use update-by-query for semantic_text migration (#220255)#220642
sorenlouv merged 6 commits intoelastic:8.17from
sorenlouv:backport/8.17/pr-220255

Conversation

@sorenlouv
Copy link
Member

Backport

This will backport the following commits from main to 8.17:

Questions ?

Please refer to the Backport tool documentation

sorenlouv and others added 2 commits May 9, 2025 12:54
…lastic#220255)

Closes: elastic#220339

**Background**
The `semantic_text` migration will migrate content from `text` field to
`semantic_text` field. It does so with a recursive function that
continuously retrieves knowledge base entries if they do not contain
`semantic_text` and updates them accordingly.

**Problem**
It is possible to save empty knowledge base entries
(elastic#220342) where `text` and
`semantic_text` will be empty. Doing this will cause the migration
script to run indefinitely leading to OOM on the affected clusters.

Temporary workaround is to delete empty knowledge base entries:

```jsonc
POST .kibana-observability-ai-assistant-kb/_delete_by_query
{
  "query": {
    "bool": {
      "must": [{ "exists": { "field": "text" }}],
      "must_not": [ { "wildcard": { "text": "*" } }
      ]
    }
  }
}
```

If you want to perform a dry run (find offending documents without
deleting them) run this:
```jsonc
GET .kibana-observability-ai-assistant-kb/_search
{
  "query": {
    "bool": {
      "must": [{ "exists": { "field": "text" }}],
      "must_not": [ { "wildcard": { "text": "*" } }
      ]
    }
  }
}
```

(cherry picked from commit 96d1692)
@sorenlouv sorenlouv requested a review from kibanamachine as a code owner May 9, 2025 10:56
@sorenlouv sorenlouv added the backport This PR is a backport of another PR label May 9, 2025
@sorenlouv sorenlouv enabled auto-merge (squash) May 9, 2025 10:56
@botelastic botelastic bot added ci:project-deploy-observability Create an Observability project Team:Obs AI Assistant Observability AI Assistant labels May 9, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ai-assistant (Team:Obs AI Assistant)

@github-actions
Copy link
Contributor

github-actions bot commented May 9, 2025

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@elasticmachine
Copy link
Contributor

⏳ Build in-progress

  • Buildkite Build
  • Commit: b9a05a2
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-220642-b9a05a2e9492

History

@sorenlouv sorenlouv merged commit 3480e41 into elastic:8.17 May 14, 2025
6 checks passed
@sorenlouv sorenlouv deleted the backport/8.17/pr-220255 branch May 14, 2025 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR ci:project-deploy-observability Create an Observability project Team:Obs AI Assistant Observability AI Assistant

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants