You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A directory content and its version vector can get out of sync which could lead to a two conflicting versions of a directory to be incorrectly merged losing the changes from one of the versions. This is because the directory content is a snapshot - when a directory is opened the content is loaded from the db and then stored in a member variable. On the other hand, it's version vector is always freshly loaded from the db. This can cause them to get out of sync which can result in incorrect merge. Consider this scenario:
There are two branches, A (local) and B (remote) and a directory with a file in it. A's version of the file is happens-after B's
We load both versions of the directory in order to merge them
Then a new snapshot of B gets completed. This snapshot has changes to the file so the versions of the file are now concurrent.
Then we load the versions vectors of the directories and calculate their merge
We then proceed with merging the entries
Because the directories were loaded before the new B snapshot was completed we don't see the concurrent versions. We see the A's version is happens-after the B's. So we keep the A's and discard the B's
We then finalize the merge applying the merged version vector from step 6.
A's branch now becomes happens-after B's and so we discard B
The changes in B are now lost
A possible fix is to load the directory version vector in the same read transaction where the directory content is loaded and then store it in a member variable as well. This would prevent them from getting out of sync preventing the above scenario: in step 6 when the merged vv is calcualated we would use the old vvs instead of the new ones and so the resulting vv after the merge would be concurrent to the new vv of B and so B would not be pruned.
The text was updated successfully, but these errors were encountered:
A directory content and its version vector can get out of sync which could lead to a two conflicting versions of a directory to be incorrectly merged losing the changes from one of the versions. This is because the directory content is a snapshot - when a directory is opened the content is loaded from the db and then stored in a member variable. On the other hand, it's version vector is always freshly loaded from the db. This can cause them to get out of sync which can result in incorrect merge. Consider this scenario:
A possible fix is to load the directory version vector in the same read transaction where the directory content is loaded and then store it in a member variable as well. This would prevent them from getting out of sync preventing the above scenario: in step 6 when the merged vv is calcualated we would use the old vvs instead of the new ones and so the resulting vv after the merge would be concurrent to the new vv of B and so B would not be pruned.
The text was updated successfully, but these errors were encountered: