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

Fix debug log for missing ISM config index #846

Merged
merged 3 commits into from
Jul 10, 2023

Conversation

ronnaksaxena
Copy link
Contributor

@ronnaksaxena ronnaksaxena commented Jul 7, 2023

More Accurate Error Message

Issue 697

Description of changes:

  • I added a check to avoid an inappropriate error being logged if the cluster was changed and the managed index config was not created yet
  • Instead a debug log will be outputted whenever there is a change in the cluster state and there is no managed config index

These would be the results of the changed output logs in different cases:

Before Change:

  1. Config index has not been created (fresh cluster essentially)
    1. Adding an index: no output
    2. Deleting an index:
[ERROR][o.o.i.i.ManagedIndexCoordinator] [integTest-0] get managed-index failed: [.opendistro-ism-config] IndexNotFoundException[no such index [.opendistro-ism-config]]
  1. Config index has been created (e.g., an ISM policy has been created)     
    1. Adding an index: no output
    2. Deleting an index: no output
  2. Config index has been deleted
    1. Adding an index: no output
    2. Deleting an index:
[ERROR][o.o.i.i.ManagedIndexCoordinator] [6c7e67c756fb] get managed-index failed: [.opendistro-ism-config] IndexNotFoundException[no such index [.opendistro-ism-config]]

After Change:

  1. Config index has not been created (fresh cluster essentially)
    1. Adding an index:
[WARN ][o.o.i.i.ManagedIndexCoordinator] [integTest-0] [.opendistro-ism-config] config index does not exist
2. Deleting an index:
[DEBUG ][o.o.i.i.ManagedIndexCoordinator] [integTest-0] [.opendistro-ism-config] config index does not exist
  1. Config index has been created (e.g., an ISM policy has been created)     
    1. Adding an index: no output
    2. Deleting an index: no output
  2. Config index has been deleted
    1. Adding an index:
[DEBUG ][o.o.i.i.ManagedIndexCoordinator] [integTest-0] [.opendistro-ism-config] config index does not exist
3. Deleting an index:
[DEBUG ][o.o.i.i.ManagedIndexCoordinator] [integTest-0] [.opendistro-ism-config] config index does not exist

CheckList:

  • [ x] Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@@ -262,6 +262,11 @@ class ManagedIndexCoordinator(
*/
@OpenForTesting
suspend fun sweepClusterChangedEvent(event: ClusterChangedEvent) {
// If IM config doesn't exist skip
if (!ismIndices.indexManagementIndexExists()) {
logger.warn("[.opendistro-ism-config] config index does not exist")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a debug level log

Copy link
Contributor Author

@ronnaksaxena ronnaksaxena Jul 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should I do logger.info() instead? @eirsep

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logger.debug(

)

@ronnaksaxena ronnaksaxena changed the title Listener does not log ERROR for unmanaged indices Fix debug log for missing ISM config index Jul 7, 2023
Signed-off-by: Ronnak Saxena <ronsax@amazon.com>
Signed-off-by: Ronnak Saxena <ronsax@amazon.com>
Signed-off-by: Ronnak Saxena <ronsax@amazon.com>
@AWSHurneyt AWSHurneyt merged commit 99df725 into opensearch-project:main Jul 10, 2023
9 of 15 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jul 10, 2023
* Does not sweep if cluster doesn't contain an ISM Config Index

Signed-off-by: Ronnak Saxena <ronsax@amazon.com>

* fixed the warn message

Signed-off-by: Ronnak Saxena <ronsax@amazon.com>

* changed log from warn to debug

Signed-off-by: Ronnak Saxena <ronsax@amazon.com>

---------

Signed-off-by: Ronnak Saxena <ronsax@amazon.com>
(cherry picked from commit 99df725)
AWSHurneyt pushed a commit that referenced this pull request Jul 28, 2023
* Does not sweep if cluster doesn't contain an ISM Config Index

Signed-off-by: Ronnak Saxena <ronsax@amazon.com>

* fixed the warn message

Signed-off-by: Ronnak Saxena <ronsax@amazon.com>

* changed log from warn to debug

Signed-off-by: Ronnak Saxena <ronsax@amazon.com>

---------

Signed-off-by: Ronnak Saxena <ronsax@amazon.com>
(cherry picked from commit 99df725)

Co-authored-by: Ronnak Saxena <63483386+ronnaksaxena@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants