Skip to content

Commit 53241c5

Browse files
authored
Queries using versions now use a serialization that requires 4.1 (#3245)
In #2943, a new serialization of the `VersionValue` was introduced, though we had to modify it in #3179 so to avoid deserialization problems when serializing and deserializing continuations across 4.0 and 4.1. With 4.2, we want to start using the new serialization path to serialize `VersionValue` children more completely. The mixed mode testing in PRB validate this change is compatible with 4.1.9.0. I've also run the full mixed mode battery for the `versionsTest` tests, and the serialization is compatible between this change and all 4.1 versions, as well as all 4.0 versions after 4.0.562.0, which is in line with what we'd expect. This resolves #3203.
1 parent 965dcbe commit 53241c5

File tree

1 file changed

+3
-17
lines changed
  • fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values

1 file changed

+3
-17
lines changed

fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/values/VersionValue.java

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -149,23 +149,9 @@ public boolean equals(final Object other) {
149149
@Nonnull
150150
@Override
151151
public PVersionValue toProto(@Nonnull final PlanSerializationContext serializationContext) {
152-
if (childValue instanceof QuantifiedRecordValue) {
153-
// Deprecated. This value previously required that the child be a QuantifiedRecordValue and only
154-
// contained the alias. To preserve cross-version compatibility with versions older than 4.0.561.0,
155-
// send messages without the full value.
156-
// Note: it's tempting to also include the full value in the `child` field, but doing so can
157-
// lead to mixed-mode errors. If there are types or plans referenced in the child, those can
158-
// be registered with the serializationContext, which means they may only be included
159-
// by reference elsewhere in the serialized plan. Older versions of the deserialization
160-
// logic don't know about the field, and so they will trip over any dangling references
161-
return PVersionValue.newBuilder()
162-
.setBaseAlias(getChildQuantifiedRecordValue().getAlias().getId())
163-
.build();
164-
} else {
165-
return PVersionValue.newBuilder()
166-
.setChild(childValue.toValueProto(serializationContext))
167-
.build();
168-
}
152+
return PVersionValue.newBuilder()
153+
.setChild(childValue.toValueProto(serializationContext))
154+
.build();
169155
}
170156

171157
@Nonnull

0 commit comments

Comments
 (0)