Skip to content

Conversation

guqing
Copy link
Member

@guqing guqing commented Jul 11, 2025

What type of PR is this?

Fix fatal bug where different strings were incorrectly considered equal (e.g., '/upload/1.4.3.png' vs '/upload/1.4.6.png' returned 0)

Tests added:

  • KeyComparatorProductionSafetyTest: comprehensive production safety checks
  • KeyComparatorRiskAnalysisTest: edge case and risk assessment tests
  • Updated existing KeyComparatorTest with new test cases

Which issue(s) this PR fixes:

Fixes #7622

Does this PR introduce a user-facing change?

修复索引排序中对特定的不同字符串被错误地认为相等的错误

@f2c-ci-robot f2c-ci-robot bot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Jul 11, 2025
@f2c-ci-robot f2c-ci-robot bot requested review from LIlGG and ruibaby July 11, 2025 06:18
Copy link

f2c-ci-robot bot commented Jul 11, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign johnniang for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

- Fix fatal bug where different strings were incorrectly considered equal
  (e.g., '/upload/1.4.3.png' vs '/upload/1.4.6.png' returned 0)
- Simplify implementation by removing complex decimal recognition logic
- Remove version number pattern detection to avoid false positives
- Maintain core numeric comparison functionality for integer segments
- Preserve leading zero handling for proper string differentiation
- Ensure index integrity and prevent data loss in production

This change addresses a critical production safety issue where the index
system could lose data due to incorrect string equality comparisons.

Tests added:
- KeyComparatorProductionSafetyTest: comprehensive production safety checks
- KeyComparatorRiskAnalysisTest: edge case and risk assessment tests
- Updated existing KeyComparatorTest with new test cases

All 86 existing tests pass, confirming backward compatibility.
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inaccurate Results When Querying by Index
1 participant