Skip to content

Conversation

@original-brownbear
Copy link
Contributor

The parsing here was causing trouble with the new streaming deserialization because it
did not fully consume the parser so if the internal buffer of the parser was just enough
to finish reading the "snapshot" field but missed the closing bracket, then the stream behind
the parser would not have been consumed fully. Also it was strangely lenient and would just read
a broken in-progress SnapshotInfo if it ran into SMILE that contained any object field
under any key that isn't "snapshot". I made it a little stricter now to enforce that
we have a "snapshot" field and not just an object field by any name.

The parsing here was causing trouble with the new streaming deserialization because it
did not fully consume the parser so if the internal buffer of the parser was just enough
to finish reading the `"snapshot"` field but missed the closing bracket, then the stream behind
the parser would not have been consumed fully. Also it was strangely lenient and would just read
a broken in-progress `SnapshotInfo` if it ran into SMILE that contained any object field
under any key that isn't "snapshot". I made it a little stricter now to enforce that
we have a "snapshot" field and not just an object field by any name.
@elasticmachine elasticmachine added the Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. label May 20, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

parser.nextToken();
}
XContentParser.Token token;
XContentParserUtils.ensureFieldName(parser, parser.currentToken(), SNAPSHOT);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kind of non-nonsensical to wrap in a "snapshot" field here to begin with I guess but that's a topic for another day I guess

@original-brownbear
Copy link
Contributor Author

original-brownbear commented May 20, 2021

Copy link
Contributor

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, taking it on trust that we never deliberately put things other than a snapshot top-level field in these blobs.

@original-brownbear
Copy link
Contributor Author

Thanks David!

taking it on trust that we never deliberately put things other than a snapshot top-level field in these blobs.

I don't know of version of ES that would have done that (that would have broken the snapshot estimator for sure and we have tests literally taking snapshots from every ES version supported on Cloud for that thing).

@original-brownbear original-brownbear merged commit 25dcc62 into elastic:master May 20, 2021
@original-brownbear original-brownbear deleted the fix-snapshot-info-parsing branch May 20, 2021 12:16
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request May 20, 2021
Similar to elastic#73268 we should be stricter here, especially when we are super-strict
about additional fields anyway. Also, use our parser exception utils to get better
exceptions if parsing fails.
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request May 20, 2021
…stic#73268)

The parsing here was causing trouble with the new streaming deserialization because it
did not fully consume the parser so if the internal buffer of the parser was just enough
to finish reading the `"snapshot"` field but missed the closing bracket, then the stream behind
the parser would not have been consumed fully. Also it was strangely lenient and would just read
a broken in-progress `SnapshotInfo` if it ran into SMILE that contained any object field
under any key that isn't "snapshot". I made it a little stricter now to enforce that
we have a "snapshot" field and not just an object field by any name.
original-brownbear added a commit that referenced this pull request May 20, 2021
) (#73274)

The parsing here was causing trouble with the new streaming deserialization because it
did not fully consume the parser so if the internal buffer of the parser was just enough
to finish reading the `"snapshot"` field but missed the closing bracket, then the stream behind
the parser would not have been consumed fully. Also it was strangely lenient and would just read
a broken in-progress `SnapshotInfo` if it ran into SMILE that contained any object field
under any key that isn't "snapshot". I made it a little stricter now to enforce that
we have a "snapshot" field and not just an object field by any name.
original-brownbear added a commit that referenced this pull request May 20, 2021
Similar to #73268 we should be stricter here, especially when we are super-strict
about additional fields anyway. Also, use our parser exception utils to get better
exceptions if parsing fails.
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request May 20, 2021
Similar to elastic#73268 we should be stricter here, especially when we are super-strict
about additional fields anyway. Also, use our parser exception utils to get better
exceptions if parsing fails.
original-brownbear added a commit that referenced this pull request May 21, 2021
Similar to #73268 we should be stricter here, especially when we are super-strict
about additional fields anyway. Also, use our parser exception utils to get better
exceptions if parsing fails.
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request Jul 1, 2021
Exactly the same as elastic#73268 but for metadata and index metadata which can run into
the same bug.
original-brownbear added a commit that referenced this pull request Jul 1, 2021
…74844)

Exactly the same as #73268 but for metadata and index metadata which can run into
the same bug.
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request Jul 13, 2021
…lastic#74844)

Exactly the same as elastic#73268 but for metadata and index metadata which can run into
the same bug.
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request Jul 13, 2021
…lastic#74844)

Exactly the same as elastic#73268 but for metadata and index metadata which can run into
the same bug.
original-brownbear added a commit that referenced this pull request Jul 13, 2021
…74844) (#75281)

Exactly the same as #73268 but for metadata and index metadata which can run into
the same bug.
original-brownbear added a commit that referenced this pull request Jul 13, 2021
…74844) (#75277)

Exactly the same as #73268 but for metadata and index metadata which can run into
the same bug.
@original-brownbear original-brownbear restored the fix-snapshot-info-parsing branch April 18, 2023 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>bug :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. v7.14.0 v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants