Fixes DocStats to properly deal with shards that report -1 index size#27863
Fixes DocStats to properly deal with shards that report -1 index size#27863colings86 merged 1 commit intoelastic:6.xfrom colings86:fix/docstatsIndexSize
Conversation
|
Note that this PR is against the 6.x branch as that is where the YAML test failed and therefore where I found the bug. I can either forward port this to master when merged or I can rebase against master as suggested by the reviewer(s). Also note that I'm not 100% sure if this is the right fix for this I am open to better suggestions for how we should deal with this case (maybe we should never report the index size as |
|
Also note that the reason the stats report |
There was a problem hiding this comment.
Good catch, I'll remove
There was a problem hiding this comment.
Are these the right versions?
There was a problem hiding this comment.
Yes I think so, these version limits were on the test prior to me muting it, see 1e9e73a
There was a problem hiding this comment.
Sure, but what about mixed cluster tests where older nodes will be running the buggy code?
There was a problem hiding this comment.
I think it should be ok (though I'm willing to be proven wrong 😄 ) since the stats are combined on a single node (they are not incrementally added together on different nodes as far as I can see), so if this is running on a 5.x node it will run as it did in 5.x (possibly with negative BytesSizeValues but that is allowed on 5.x) and pass (as it does on the pure 5.x tests). If the test runs against a 6.x node it will have the DocsStats fix to ensure the sizes are added together correctly and the least value passed to the ByteSizeValue will be -1 which is allowed in 6.x.
There was a problem hiding this comment.
@jasontedor do you still have concerns here or are you happy for me to merge this PR?
There was a problem hiding this comment.
if (this.totalSizeInBytes == -1) {
this.totalSizeInBytes = other.totalSizeInBytes;
} else if (other.totalSizeInBytes != -1) {
this.totalSizeInBytes += other.totalSizeInBytes;
}
|
In c20d1dc I muted: Also I added the URL of this PR to the previously-muted: Please could you restore these? |
|
@DaveCTurner thanks, I've unmuted those tests in this PR |
Previously to this change when DocStats are added together (for example when adding the index size of all primary shards for an index) we naively added the `totalSizeInBytes` together. This worked most of the time but not when the index size on one or multiple shards was reported to be `-1` (no value). This change improves the logic by considering if the current value or the value to be added is `-1`: * If the current and new value are both `-1` the value remains at `-1` * If the current value is `-1` and the new value is not `-1`, current value is changed to be equal to the new value * If the current value is not `-1` and the new value is `-1` the new value is ignored and the current value is not changed * If both the current and new values are not `-1` the current value is changed to be equal to the sum of the current and new values. The change also re-enables the failing rollover YAML test that was failing due to this bug.
|
I have marked this PR as backport pending but in fact in this case a forward port to master is required. I will do this as soon as I have ensured the 6.x intake build passes. |
Previously to this change when DocStats are added together (for example when adding the index size of all primary shards for an index) we naively added the `totalSizeInBytes` together. This worked most of the time but not when the index size on one or multiple shards was reported to be `-1` (no value). This change improves the logic by considering if the current value or the value to be added is `-1`: * If the current and new value are both `-1` the value remains at `-1` * If the current value is `-1` and the new value is not `-1`, current value is changed to be equal to the new value * If the current value is not `-1` and the new value is `-1` the new value is ignored and the current value is not changed * If both the current and new values are not `-1` the current value is changed to be equal to the sum of the current and new values. The change also re-enables the failing rollover YAML test that was failing due to this bug.
|
Forward port is now done |
* es/master: (45 commits) Adapt scroll rest test after backport. relates #27842 Move early termination based on index sort to TopDocs collector (#27666) Upgrade beats templates that we use for bwc testing. (#27929) ingest: upgraded ingest geoip's geoip2's dependencies. [TEST] logging for update by query test #27820 Add elasticsearch-nio jar for base nio classes (#27801) Use full profile on JDK 10 builds Require Gradle 4.3 Enable grok processor to support long, double and boolean (#27896) Add unreleased v6.1.2 version TEST: reduce blob size #testExecuteMultipartUpload Check index under the store metadata lock (#27768) Fixes DocStats to not report index size < -1 (#27863) Fixed test to be up to date with the new database files. Upgrade to Lucene 7.2.0. (#27910) Disable TestZenDiscovery in cloud providers integrations test Use `_refresh` to shrink the version map on inactivity (#27918) Make KeyedLock reentrant (#27920) ingest: Upgraded the geolite2 databases. [Test] Fix IndicesClientDocumentationIT (#27899) ...
* es/6.x: (43 commits) ingest: upgraded ingest geoip's geoip2's dependencies. [TEST] logging for update by query test #27820 Use full profile on JDK 10 builds Require Gradle 4.3 Add unreleased v6.1.2 version TEST: reduce blob size #testExecuteMultipartUpload Check index under the store metadata lock (#27768) Upgrade to Lucene 7.2.0. (#27910) Fixed test to be up to date with the new database files. Use `_refresh` to shrink the version map on inactivity (#27918) Make KeyedLock reentrant (#27920) Fixes DocStats to not report index size < -1 (#27863) Disable TestZenDiscovery in cloud providers integrations test ingest: Upgraded the geolite2 databases. [Issue-27716]: CONTRIBUTING.md IntelliJ configurations settings are confusing. (#27717) [Test] Fix IndicesClientDocumentationIT (#27899) Move uid lock into LiveVersionMap (#27905) Mute testRetentionPolicyChangeDuringRecovery Increase Gradle heap space to 1536m Move GlobalCheckpointTracker and remove SequenceNumbersService (#27837) ...
Previously to this change when DocStats are added together (for example when adding the index size of all primary shards for an index) we naively added the
totalSizeInBytestogether. This worked most of the time but not when the index size on one or multiple shards was reported to be-1(no value).This change improves the logic by considering if the current value or the value to be added is
-1:-1the value remains at-1-1and the new value is not-1, current value is changed to be equal to the new value-1and the new value is-1the new value is ignored and the current value is not changed-1the current value is changed to be equal to the sum of the current and new values.The change also re-enables the failing rollover YAML test that was failing due to this bug.