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

index slowlog settings override other indices settings #42432

Closed
jkakavas opened this issue May 23, 2019 · 1 comment · Fixed by #47234
Closed

index slowlog settings override other indices settings #42432

jkakavas opened this issue May 23, 2019 · 1 comment · Fixed by #47234
Labels
>bug :Core/Infra/Logging Log management and logging utilities

Comments

@jkakavas
Copy link
Member

jkakavas commented May 23, 2019

Elasticsearch version : Tested with 6.6.1 and master

Description of the problem including expected versus actual behavior:
Slowlog settings are supposed to be per index. However, setting the slowlog settings for an index, override the respective settings in all other indices, even when these other settings have been previously configured.

Steps to reproduce:

  1. Create index test_1 and set index.search.slowlog.level: warn and index.search.slowlog.threshold.query.trace to 0.
curl -X PUT  -H 'Content-Type: application/json' 'http://localhost:9200/test_1/_settings' -d '{"settings": {"index.search.slowlog.level": "warn", "index.search.slowlog.threshold.query.trace": 0}}'

Get the settings to verify it is set correctly

curl -uelastic:password -X GET 'http://localhost:9200/test_1/_settings'

should return

...
"test_1" : {
    "settings" : {
      "index" : {
        "search" : {
          "slowlog" : {
            "level" : "warn",
            "threshold" : {
              "query" : {
                "trace" : "0"
              }
            }
          }
        },
...
  1. Make a few searches
curl -X GET 'http://localhost:9200/test_1/_search'

and verify nothing is printed in the *.index_search_slowlog.log

  1. Create index test_2 and set index.search.slowlog.level: trace and index.search.slowlog.threshold.query.trace to 0.
curl -X PUT  -H 'Content-Type: application/json' 'http://localhost:9200/test_2/_settings' -d '{"settings": {"index.search.slowlog.level": "warn", "index.search.slowlog.threshold.query.trace": 0}}'

Get the settings to verify it is set correctly

curl -uelastic:password -X GET 'http://localhost:9200/test_2/_settings'

should return

...
"test_2" : {
    "settings" : {
      "index" : {
        "search" : {
          "slowlog" : {
            "level" : "trace",
            "threshold" : {
              "query" : {
                "trace" : "0"
              }
            }
          }
        },
...

Verify also that the settings for test_1 have not been changed ( at least that's reported ):

curl -uelastic:password -X GET 'http://localhost:9200/test_1/_settings'

should still return

...
"test_1" : {
    "settings" : {
      "index" : {
        "search" : {
          "slowlog" : {
            "level" : "warn",
            "threshold" : {
              "query" : {
                "trace" : "0"
              }
            }
          }
        },
...
  1. Make a search in test_1 again
curl -X GET 'http://localhost:9200/test_1/_search'

Observe log lines such as

[2019-05-23T13:27:38,633][TRACE][i.s.s.query              ] [node-0] [test_1][0] took[218.5micros], took_millis[0], total_hits[0 hits], types[], stats[], search_type[QUERY_THEN_FETCH], total_shards[1], source[{}], id[],

in the *.index_search_slowlog.log

@jkakavas jkakavas added :Core/Infra/Logging Log management and logging utilities >bug labels May 23, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

pgomulka pushed a commit that referenced this issue Oct 17, 2019
SlowLog instances should not share the same underlying logger, as it would cause different indexes override each other levels. When creating underlying logger, unique per index identifier should be used. Name + IndexSettings.UUID

Closes #42432
pgomulka pushed a commit to pgomulka/elasticsearch that referenced this issue Oct 17, 2019
…47234)

SlowLog instances should not share the same underlying logger, as it would cause different indexes override each other levels. When creating underlying logger, unique per index identifier should be used. Name + IndexSettings.UUID

Closes elastic#42432
pgomulka pushed a commit to pgomulka/elasticsearch that referenced this issue Oct 17, 2019
…47234)

SlowLog instances should not share the same underlying logger, as it would cause different indexes override each other levels. When creating underlying logger, unique per index identifier should be used. Name + IndexSettings.UUID

Closes elastic#42432
pgomulka added a commit that referenced this issue Oct 17, 2019
…KPORT(#47234) (#48176)

* Slow log must use separate underlying logger for each index (#47234)

SlowLog instances should not share the same underlying logger, as it would cause different indexes override each other levels. When creating underlying logger, unique per index identifier should be used. Name + IndexSettings.UUID

Closes #42432
pgomulka added a commit that referenced this issue Oct 17, 2019
…KPORT(#47234) (#48177)

* Slow log must use separate underlying logger for each index (#47234)

SlowLog instances should not share the same underlying logger, as it would cause different indexes override each other levels. When creating underlying logger, unique per index identifier should be used. Name + IndexSettings.UUID

Closes #42432
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Core/Infra/Logging Log management and logging utilities
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants