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

[Search Sessions] Kibana fails to update or delete sessions in non-default space #96124

Closed
Dosant opened this issue Apr 2, 2021 · 4 comments
Closed
Labels
bug Fixes for quality problems that affect the customer experience Feature:Search Querying infrastructure in Kibana v7.12.0

Comments

@Dosant
Copy link
Contributor

Dosant commented Apr 2, 2021

Kibana version: 7.12.0

Elasticsearch version: 7.12.0

Server OS version:

Original install method (e.g. download page, yum, from source, etc.): From source or cloud

Describe the bug:

Kibana fails to update and delete search sessions created in non-default space.

This leads to cluster performance degradation caused by a growing number of periodic _async_search/status/<id> requests from Kibana to ES.

Steps to reproduce:

  1. Create non-default space. Run from non-default space some searches from Discover or Dashboard
  2. Using dev tools observe a growing number of search-sessions objects
GET .kibana*/_search
{
  "query": {
    "match": {
      "type": "search-session"
    }
  }
}
  1. Search session objects created in non-default space not transition from IN-PROGRESS -> COMPLETED state and not deleted.

Expected behavior:

When searches complete, the session object should be transitioned to COMPLETED state and then in ~1m completely deleted.
The behavior in the default space is expected.

Screenshots (if relevant):

Symptoms:

Screen Shot 2021-04-01 at 10 05 23

Any additional context:

Workaround

To stabilize cluster manually delete search-sessions objects. This has to be done periodically:

POST .kibana_*/_delete_by_query
{
  "query": {
    "bool": {
      "must": [{
        "match": {
          "type": "search-session"
        }
      }, {
        "match": {
          "search-session.persisted": false
        }
      }]
    }
  }
}

And/or disable search-sessions feature in kibana.yml:

xpack.data_enhanced.search.sessions.enabled: false

With search-sessions disabled, session monitoring which calls _async_search/status/<id> will not be scheduled: the number of search-session objects will still grow in a cluster, but tasks that processing them will not run hence not affect cluster performance.

After restarting a 7.12 cluster with xpack.data_enhanced.search.sessions.enabled: false also make sure that the task doesn't exist from the previous run.

GET .kibana_task_manager*/_search
{
  "query": {
    "match": {
      "_id": "task:data_enhanced_search_sessions_monitor"
    }
  }
}

If it exists, then delete it:

POST /.kibana_task_manager*/_delete_by_query
{
  "query": {
    "match": {
      "_id": "task:data_enhanced_search_sessions_monitor"
    }
  }
}
@Dosant Dosant added bug Fixes for quality problems that affect the customer experience Feature:Search Querying infrastructure in Kibana Team:AppServices v7.12.0 labels Apr 2, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-services (Team:AppServices)

@geekpete
Copy link
Member

geekpete commented Apr 5, 2021

Wondering if this could be related in any way (might not be, but wasn't originally reproduced/solved) #53255

@Dosant
Copy link
Contributor Author

Dosant commented Apr 8, 2021

@geekpete,

Wondering if this could be related in any way (might not be, but wasn't originally reproduced/solved) #53255

Looks like different bugs since the current issue applied only to 7.12.0 and search-sesison features.
The underlying reason could be related - misuse of namespaces/permissions APIs, but this should be investigated/fixed separately

@Dosant
Copy link
Contributor Author

Dosant commented Apr 8, 2021

Fixed by #96123

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Search Querying infrastructure in Kibana v7.12.0
Projects
None yet
Development

No branches or pull requests

3 participants