-
Notifications
You must be signed in to change notification settings - Fork 25k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gate reading of optional string array for bwc #106878
Gate reading of optional string array for bwc #106878
Conversation
Pinging @elastic/es-storage-engine (Team:StorageEngine) |
...n/downsample/src/main/java/org/elasticsearch/xpack/downsample/DownsampleShardTaskParams.java
Outdated
Show resolved
Hide resolved
...n/downsample/src/main/java/org/elasticsearch/xpack/downsample/DownsampleShardTaskParams.java
Outdated
Show resolved
Hide resolved
...ugin/downsample/src/main/java/org/elasticsearch/xpack/downsample/DownsampleShardIndexer.java
Outdated
Show resolved
Hide resolved
Note that this issue as a side effect described here #106880 |
Hi @salvatore-campagna, I've created a changelog YAML for you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left one question otherwise LGTM
...ugin/downsample/src/main/java/org/elasticsearch/xpack/downsample/DownsampleShardIndexer.java
Show resolved
Hide resolved
...n/downsample/src/main/java/org/elasticsearch/xpack/downsample/DownsampleShardTaskParams.java
Show resolved
Hide resolved
x-pack/plugin/downsample/qa/mixed-cluster/src/javaRestTest/resources/tsdb-bulk-request.txt
Outdated
Show resolved
Hide resolved
Missing a check on the transport version results in unreadable cluster state if it includes a serialized instance of DownsampleShardTaskParams. serie indices. Reading an optional array requires reading a boolean first which is required to know if an array of values exists in serialized form. From 8.13 on we try to read such a boolean which is not there because older versions don't write any boolean nor any string array. Here we include the check on versions for backward compatibility skipping reading any boolean or array whatsoever whenever not possible. Customers using downsampling might have cluster states including such serielized objects and would be unable to upgrade to version 8.13. They will be able to upgrade to any version including this fix. This fix has a side effect elastic#106880
…06896) Missing a check on the transport version results in unreadable cluster state if it includes a serialized instance of DownsampleShardTaskParams. serie indices. Reading an optional array requires reading a boolean first which is required to know if an array of values exists in serialized form. From 8.13 on we try to read such a boolean which is not there because older versions don't write any boolean nor any string array. Here we include the check on versions for backward compatibility skipping reading any boolean or array whatsoever whenever not possible. Customers using downsampling might have cluster states including such serielized objects and would be unable to upgrade to version 8.13. They will be able to upgrade to any version including this fix. This fix has a side effect #106880 Co-authored-by: Salvatore Campagna <[email protected]>
Backported to 8.13 in #106896 |
@@ -564,6 +564,15 @@ public XContentBuilder buildDownsampleDocument() throws IOException { | |||
fieldProducer.write(builder); | |||
} | |||
|
|||
if (dimensions.length == 0) { | |||
logger.debug("extracting dimensions from legacy tsid"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there are two dimensions here:
- Older index, using legacy tsid. This is controlled by IndexVersion.
- Older transport layer, passing no dimensions. This is controlled by TransportVersion.
It seems possible to have a mix of older indexes with newer transport, as well as newer indexes with older transport. If so, can this fail in case we use a newer index (created in 8.13) with an updated tsid, through an older persistent task? @salvatore-campagna thoughts?
Missing a check on the transport version results in unreadable cluster state
if it includes a serialized instance of
DownsampleShardTaskParams
.#98023 introduced an optional string array including dimensions used by time
serie indices.
Reading an optional array requires reading a boolean first which is required to
know if an array of values exists in serialized form. From 8.13 on we try to
read such a boolean which is not there because older versions don't write any
boolean nor any string array. Here we include the check on versions for backward
compatibility skipping reading any boolean or array whatsoever whenever not possible.
Customers using downsampling might have cluster states including such serielized
objects and would be unable to upgrade to version 8.13. They will be able to
upgrade to any version including this fix.
This fix has a side effect #106880