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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternative fix for aliases, pass a global alias map around #9283

Closed
wants to merge 2 commits into from

Conversation

Frassle
Copy link
Member

@Frassle Frassle commented Mar 24, 2022

No description provided.

@iwahbe
Copy link
Member

iwahbe commented Mar 24, 2022

I'm confused what problem this is trying to solve. Do we expect this to cut down the number of aliases in the state file?

@mikhailshilkov
Copy link
Member

mikhailshilkov commented Mar 24, 2022

@iwahbe The same problem #9089 that #9282 reverts that #9275 tried to solve but broke the build

@Frassle
Copy link
Member Author

Frassle commented Mar 24, 2022

This needs to go on top of the changes in #9275. It's an "alternative" in the sense of today we needed a fix for the build and it wasn't clear if we should just revert 9275 or merge this.

@pgavlin
Copy link
Member

pgavlin commented Mar 24, 2022

Just for the sake of posterity:

The after a resource operation finishes, the snapshotter needs to write out a new copy of the snapshot. However, at the time we write the snapshot, there may be resources that have not yet been registered that refer to the just-registered resources by a different URN due to aliasing. Those references need to be fixed up prior to writing the snapshot in order to preserve the snapshot's integrity (in particular, the property that all URNs refer to resources that exist in the snapshot).

For example, consider the following simple dependency graph: A <-- B. When that graph is serialized, B will contain a reference to A in its dependency list. Let the next run of the program produces the graph A' <-- B where A' is aliased to A. After A' is registered, the snapshotter needs to write a snapshot that contains its state, but B must also be updated so it references A' instead of A, which will no longer be in the snapshot.

@AaronFriel
Copy link
Member

AaronFriel commented Mar 25, 2022

I prefer #9288 here over introducing global state and the possible race condition above.

@Frassle Frassle closed this Mar 25, 2022
@Frassle Frassle deleted the fraser/altAliasesFix branch March 25, 2022 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants