You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "littleeleventhwolf (via GitHub)" <gi...@apache.org> on 2025/05/09 12:37:17 UTC
[PR] [hotfix][state] Remove duplicate comparing about intersect group range. [flink]
littleeleventhwolf opened a new pull request, #26544:
URL: https://github.com/apache/flink/pull/26544
## What is the purpose of the change
Remove duplicate comparing about intersect group range in Score of state handle.
## Brief change log
Fix the compareTo logic.
## Verifying this change
Please make sure both new and modified tests in this PR follow [the conventions for tests defined in our code quality guide](https://flink.apache.org/how-to-contribute/code-style-and-quality-common/#7-testing).
*(Please pick either of the following options)*
This change is a trivial rework / code cleanup without any test coverage.
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): (no)
- The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (no)
- The serializers: (no)
- The runtime per-record code paths (performance sensitive): (no)
- Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (no)
- The S3 file system connector: (no)
## Documentation
- Does this pull request introduce a new feature? (no)
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [hotfix][state] Remove duplicate comparing about intersect group range. [flink]
Posted by "flinkbot (via GitHub)" <gi...@apache.org>.
flinkbot commented on PR #26544:
URL: https://github.com/apache/flink/pull/26544#issuecomment-2866402386
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "a19fadb9c8211750a20965555ceb10591534b507",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "a19fadb9c8211750a20965555ceb10591534b507",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* a19fadb9c8211750a20965555ceb10591534b507 UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run azure` re-run the last Azure build
</details>
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [hotfix][state] Remove duplicate comparing about intersect group range. [flink]
Posted by "davidradl (via GitHub)" <gi...@apache.org>.
davidradl commented on code in PR #26544:
URL: https://github.com/apache/flink/pull/26544#discussion_r2084247238
##########
flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/state/rocksdb/RocksDBIncrementalCheckpointUtils.java:
##########
@@ -115,7 +115,6 @@ public double getOverlapFraction() {
public int compareTo(@Nullable Score other) {
return Comparator.nullsFirst(
Comparator.comparing(Score::getIntersectGroupRange)
- .thenComparing(Score::getIntersectGroupRange)
Review Comment:
Ah I see - it is not change behaviour just removing the duplicate. I agree no need to add more unit tests.
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [hotfix][state] Remove duplicate comparing about intersect group range. [flink]
Posted by "lsyldliu (via GitHub)" <gi...@apache.org>.
lsyldliu merged PR #26544:
URL: https://github.com/apache/flink/pull/26544
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [hotfix][state] Remove duplicate comparing about intersect group range. [flink]
Posted by "littleeleventhwolf (via GitHub)" <gi...@apache.org>.
littleeleventhwolf commented on code in PR #26544:
URL: https://github.com/apache/flink/pull/26544#discussion_r2084218746
##########
flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/state/rocksdb/RocksDBIncrementalCheckpointUtils.java:
##########
@@ -115,7 +115,6 @@ public double getOverlapFraction() {
public int compareTo(@Nullable Score other) {
return Comparator.nullsFirst(
Comparator.comparing(Score::getIntersectGroupRange)
- .thenComparing(Score::getIntersectGroupRange)
Review Comment:
Thanks for the review suggestion. However, I have a different opinion:
1. The `Score` class is a private inner class, and its `compareTo` method is only used internally.
2. The correctness of this change is already covered by existing test: `RocksDBIncrementalCheckpointUtilsTest#testChooseTheBestStateHandleForInitial`
- This test verifies the entire call chain including Score.compareTo()
- The test results remain the same after removing the duplicate comparison
3. To add a direct unit test for Score.compareTo(), we would need to:
- Change Score's visibility to package-private. It seems unnecessary for such a trivial bug fix I believe the existing test coverage is sufficient for this change.
What do you think?
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [hotfix][state] Remove duplicate comparing about intersect group range. [flink]
Posted by "davidradl (via GitHub)" <gi...@apache.org>.
davidradl commented on code in PR #26544:
URL: https://github.com/apache/flink/pull/26544#discussion_r2084125236
##########
flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/state/rocksdb/RocksDBIncrementalCheckpointUtils.java:
##########
@@ -115,7 +115,6 @@ public double getOverlapFraction() {
public int compareTo(@Nullable Score other) {
return Comparator.nullsFirst(
Comparator.comparing(Score::getIntersectGroupRange)
- .thenComparing(Score::getIntersectGroupRange)
Review Comment:
Please could you add a unit test for this scenario
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [hotfix][state] Remove duplicate comparing about intersect group range. [flink]
Posted by "littleeleventhwolf (via GitHub)" <gi...@apache.org>.
littleeleventhwolf commented on PR #26544:
URL: https://github.com/apache/flink/pull/26544#issuecomment-2870632050
Hi,@StefanRRichter. I notice there's a duplicate comparison in the `Score.compareTo` method. Would you mind taking a look since you're familiar with this part of the 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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [hotfix][state] Remove duplicate comparing about intersect group range. [flink]
Posted by "davidradl (via GitHub)" <gi...@apache.org>.
davidradl commented on code in PR #26544:
URL: https://github.com/apache/flink/pull/26544#discussion_r2084247238
##########
flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/state/rocksdb/RocksDBIncrementalCheckpointUtils.java:
##########
@@ -115,7 +115,6 @@ public double getOverlapFraction() {
public int compareTo(@Nullable Score other) {
return Comparator.nullsFirst(
Comparator.comparing(Score::getIntersectGroupRange)
- .thenComparing(Score::getIntersectGroupRange)
Review Comment:
Ah I see - it is not change behaviour just removing the duplicate. I agree no need to unit test.
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org