Skip to content

Fix: modify the logic error of EventChangedType in EtcdRepository.java #38561

Open
AsyncKurisu wants to merge 2 commits intoapache:masterfrom
AsyncKurisu:issue_33134
Open

Fix: modify the logic error of EventChangedType in EtcdRepository.java #38561
AsyncKurisu wants to merge 2 commits intoapache:masterfrom
AsyncKurisu:issue_33134

Conversation

@AsyncKurisu
Copy link
Copy Markdown

@AsyncKurisu AsyncKurisu commented Mar 26, 2026

Fixes #33134

Problem Description:
The incorrect event type determined in getEventChangedType() is propagated into the DataChangedEvent object. Since subsequent metadata refresh logic relies entirely on event.getType(), the misclassified type leads to incorrect execution paths in both onChange() and handle(). As a result, a DELETE event may be processed as an ADD event, preventing the expected metadata removal and causing metadata refresh inconsistencies.

Changes proposed in this pull request:

  • modify the logic for checking when version=1 in getEventChangedType in EtcdRepository.java
  • add test functions for verifying the correctness of the WatchEvent.EventType

Before committing this PR, I'm sure that I have checked the following options:

  • My code follows the code of conduct of this project.
  • I have self-reviewed the commit code.
  • I have (or in comment I request) added corresponding labels for the pull request.
  • I have passed maven check locally : ./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e.
  • I have made corresponding changes to the documentation.
  • I have added corresponding unit tests for my changes.
  • I have updated the Release Notes of the current development version. For more details, see Update Release Note

AsyncKurisu

This comment was marked as abuse.

@AsyncKurisu
Copy link
Copy Markdown
Author

@terrymanu Can you please review this pr?

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.

drop rule, but rule config in memory not drop

1 participant