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: resolve rollover issue with index and ism policy improvents #19

Merged
merged 1 commit into from
Nov 27, 2024

Conversation

jboix
Copy link
Contributor

@jboix jboix commented Nov 26, 2024

Description

Addresses the issue where rollover was not resolving as intended, leading to a single index accumulating all documents without purging.

BREAKING CHANGE: The index name has been changed from actions to events, requiring manual deletion of the old actions index. A migration guide is available.

Changes Made

  1. The index configuration now uses 3 shards and 1 replica to distribute the load evenly across the cluster's 3 data nodes. The index name has been changed to events to enforce this setting.
  2. An index template with a rollover_alias has been created to ensure rollover operations work correctly and don't hang.
  3. Updated ISM policy:
  • Rollover now occurs daily, allowing for more granular purging after 14 days.
  • Introduced a warm state for indexes older than 7 days an action reduces the number of replicas to 0.

Migration Guide

1. Stop the data-transfer service

2. Clean up OpenSearch cluster

Delete all indexes:

curl -X DELETE "https://<opensearch_host>/actions*" -H "Content-Type: application/json"

Delete ISM policies:

curl -X DELETE "https://<opensearch_host>/_plugins/_ism/policies/actions_policy" -H "Content-Type: application/json"

3. Update the data-transfer service to the latest version

4. Restart the service

Checklist

  • I have followed the project's style and contribution guidelines.
  • I have performed a self-review of my own changes.
  • I have made corresponding changes to the documentation.
  • I have added tests that prove my fix is effective or that my feature works.

Copy link

github-actions bot commented Nov 26, 2024

Coverage Report

Overall Project 65.3% 🍏
Files changed 100% 🍏

File Coverage
ISMPolicySetupTask.kt 100% 🍏
OpenSearchSetupService.kt 100% 🍏
IndexTemplateSetupTask.kt 100% 🍏
IndexSetupTask.kt 100% 🍏
AliasSetupTask.kt 100% 🍏
EventRequest.kt 98.51% 🍏

@jboix jboix force-pushed the fix/rollover-and-sharding branch 2 times, most recently from 0ea9280 to b04b9f3 Compare November 26, 2024 18:16
@jboix jboix requested a review from MGaetan89 November 26, 2024 18:16
@jboix jboix self-assigned this Nov 26, 2024
@jboix jboix marked this pull request as ready for review November 26, 2024 18:16
@jboix jboix force-pushed the fix/rollover-and-sharding branch from b04b9f3 to d4f3f29 Compare November 27, 2024 10:36
This commit addresses the issue where rollover was not resolving as intended, leading to a single
index accumulating all documents without purging.

BREAKING CHANGE: The index name has been changed from "actions" to "events", requiring manual
deletion of the old "actions" index.

Key changes:

1. The index configuration now uses 3 shards and 1 replica to distribute the load evenly across
   the cluster's 3 data nodes. The index name has been changed to `events` to enforce this setting.
2. An index template with a `rollover_alias` has been created to ensure rollover operations work
   correctly and don't hang.
3. Updated ISM policy:
  - Rollover now occurs daily, allowing for more granular purging after 14 days.
  - Introduced a warm state for indexes older than 7 days an action reduces the number of replicas
    to 0.
@jboix jboix force-pushed the fix/rollover-and-sharding branch from d4f3f29 to bcd08f3 Compare November 27, 2024 13:55
@jboix jboix enabled auto-merge November 27, 2024 13:55
@jboix jboix added this pull request to the merge queue Nov 27, 2024
Merged via the queue into main with commit b67f462 Nov 27, 2024
1 check passed
@jboix jboix deleted the fix/rollover-and-sharding branch November 27, 2024 14:03
Copy link

🎉 This PR is included in version 3.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants