Skip to content
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

[backport 2.11] lyaml: fix alias serialization #9790

Conversation

Totktonada
Copy link
Member

(This is a backport of PR #9777 to release/2.11, future 2.11.3 release.)


The #8350 was introduced by the commit b42302f ("lua-yaml: enable aliasing for objects returned by __serialize") so the patch is effectively reversed.

The idea is to call all object __serialize methods recursively before finding references. The new serialization pass stores the mapping from the original object to the serialized representation.

After this, the reference analysis pass and the encoding pass use this mapping to replace original objects with the serialized representation.

As result, the reference analysis has a complete information about objects and no references are missed.

Closes #8350
Closes #8310
Closes #8321

The tarantool#8350 was introduced by the commit b42302f ("lua-yaml: enable
aliasing for objects returned by __serialize") so the patch is
effectively reversed.

The idea is to call all object __serialize methods recursively before
finding references. The new serialization pass stores the mapping from
the original object to the serialized representation.

After this, the reference analysis pass and the encoding pass use this
mapping to replace original objects with the serialized representation.

As result, the reference analysis has a complete information about
objects and no references are missed.

Closes tarantool#8350
Closes tarantool#8310
Closes tarantool#8321

NO_DOC=bugfix

Co-authored-by: Nikolay Shirokovskiy <nshirokovskiy@tarantool.org>
(cherry picked from commit 610f5fb)
@coveralls
Copy link

Coverage Status

coverage: 85.799% (-0.001%) from 85.8%
when pulling de3b867 on Totktonada:fix-serialization-anchors-var-2-2.11
into 12bacb6
on tarantool:release/2.11
.

@Totktonada Totktonada added the full-ci Enables all tests for a pull request label Mar 11, 2024
@Totktonada Totktonada merged commit 09bb3e9 into tarantool:release/2.11 Mar 12, 2024
161 checks passed
@Totktonada Totktonada deleted the fix-serialization-anchors-var-2-2.11 branch March 12, 2024 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
full-ci Enables all tests for a pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants