dataroaring opened a new pull request, #62065: URL: https://github.com/apache/doris/pull/62065
## Summary - The binary search uses \`right = size - 1\` and \`right = middle - 1\`, a lower_bound variant that can miss notifying observers at boundaries - When \`size > 1\` and the matching element is at the boundary, \`right = middle - 1\` can skip past it, returning an index that excludes observers that should have been notified - The post-loop fixup (\`if (right == -1) return 0\` and \`value >= rightValue ? right + 1 : right\`) is fragile and doesn't cover all edge cases - Fix: use the standard upper_bound pattern with \`right = size\` and \`right = middle\` (no \`-1\`), which correctly returns the count of elements whose \`targetJournalVersion <= value\` ## Test plan - [ ] Verify followers waiting on specific journal versions are notified correctly - [ ] Verify \`waitOn()\` completes when the expected journal version is replayed 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
