Skip to content

Conversation

@r14chandra
Copy link
Contributor

@r14chandra r14chandra commented Nov 17, 2025

Why do we need this change? 💭

Resolves RHINENG-22092

Sharing the same group ID between suggestions_engine and system_eraser causes Kafka to distribute messages between them, resulting in message loss.

Documentation update? 📝

  • Yes
  • No

Security Checklist 🔒

Upon raising this PR please go through RedHatInsights/secure-coding-checklist

💂‍♂️ Checklist 🎯

  • Bugfix
  • New Feature
  • Refactor
  • Unittests Added
  • DRY code
  • Dependency Added
  • DB Migration Added

Additional 📣

Feel free to add any other relevant details such as links, notes, screenshots, here.

Summary by Sourcery

Assign a dedicated Kafka consumer group ID to the system eraser service to prevent message distribution conflicts and potential message loss.

Bug Fixes:

  • Use GROUP_ID_SYSTEM_ERASER instead of GROUP_ID_SUGGESTIONS_ENGINE when initializing the system eraser Kafka consumer

Enhancements:

  • Introduce GROUP_ID_SYSTEM_ERASER configuration variable with default 'system-eraser-group'

@sourcery-ai
Copy link

sourcery-ai bot commented Nov 17, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR isolates the Kafka consumer group for the system eraser service by introducing a dedicated GROUP_ID_SYSTEM_ERASER configuration and updating the SystemEraser consumer to use it, preventing message loss caused by sharing the group with suggestions_engine.

Class diagram for updated SystemEraser initialization

classDiagram
  class SystemEraser {
    - consumer
    - service
    - event
    - running
    + __init__()
  }
  class consume {
    + init_consumer(topic, group_id)
  }
  SystemEraser --> consume: uses

  class config {
    + GROUP_ID_SUGGESTIONS_ENGINE
    + GROUP_ID_SYSTEM_ERASER
  }
Loading

File-Level Changes

Change Details Files
Introduce a new consumer group ID config for system eraser
  • Add GROUP_ID_SYSTEM_ERASER env var with default ‘system-eraser-group’ in config
  • Import and expose the new constant alongside existing group IDs
ros/lib/config.py
Switch SystemEraser to use the new group ID
  • Replace GROUP_ID_SUGGESTIONS_ENGINE with GROUP_ID_SYSTEM_ERASER in init_consumer call
ros/processor/system_eraser.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@r14chandra r14chandra merged commit bf169c8 into RedHatInsights:main Nov 17, 2025
14 of 15 checks passed
@r14chandra r14chandra deleted the update-system-eraser-group-id branch November 17, 2025 09:56
@r14chandra r14chandra changed the title update group-id for system eraser service RHINENG-17707 - update group-id for system eraser service Nov 17, 2025
@r14chandra r14chandra changed the title RHINENG-17707 - update group-id for system eraser service RHINENG-17707 Update group-id for system eraser service Nov 17, 2025
@r14chandra r14chandra changed the title RHINENG-17707 Update group-id for system eraser service RHINENG-22092 Update group-id for system eraser service Nov 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant