Commit 636bd77
[release/2.22] fix(merge-tree): Correctly bookkeep insert into local-only obliterate (#23937)
## Description
Resolves some issues in obliterate's insert codepath related to unacked
obliterates over the range being inserted into. The gist of the change
is that we did not properly bookkeep a scenario where:
- The local client has an outstanding obliterate for a range
- Multiple other clients also obliterated this range and attempted to
insert into it
In this case, the local client knows that eventually, the remote clients
won't have won the rights to insert into that range (since the local
obliterate will remove the segment). However, remote clients won't know
this until the local client's obliterate is acked. Therefore if remote
clients make subsequent changes without seeing the local client's
obliterate, the local client may interpret them incorrectly.
The fix here is to fix the bookkeeping of the inserted segment on the
local client in the case above, which can be done by being a bit more
thorough on examining any overlapping obliterates (specifically,
tracking the newest acked obliterate and oldest unacked obliterate
separately from the newest overall). See unit tests for more details.
[AB#31009](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/31009)
Cherry-pick of #23934 into 2.22 release branch.
Co-authored-by: Abram Sanderson <[email protected]>1 parent a97b167 commit 636bd77
File tree
2 files changed
+126
-9
lines changed- packages/dds/merge-tree/src
- test
2 files changed
+126
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1611 | 1611 | | |
1612 | 1612 | | |
1613 | 1613 | | |
| 1614 | + | |
| 1615 | + | |
1614 | 1616 | | |
1615 | 1617 | | |
1616 | 1618 | | |
| |||
1641 | 1643 | | |
1642 | 1644 | | |
1643 | 1645 | | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
1644 | 1663 | | |
1645 | 1664 | | |
1646 | 1665 | | |
| |||
1649 | 1668 | | |
1650 | 1669 | | |
1651 | 1670 | | |
1652 | | - | |
1653 | | - | |
1654 | | - | |
1655 | | - | |
1656 | | - | |
1657 | | - | |
1658 | | - | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
1659 | 1696 | | |
1660 | 1697 | | |
1661 | 1698 | | |
1662 | 1699 | | |
1663 | 1700 | | |
1664 | | - | |
| 1701 | + | |
1665 | 1702 | | |
1666 | 1703 | | |
1667 | 1704 | | |
1668 | | - | |
| 1705 | + | |
1669 | 1706 | | |
1670 | 1707 | | |
1671 | 1708 | | |
| |||
Lines changed: 80 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1911 | 1911 | | |
1912 | 1912 | | |
1913 | 1913 | | |
| 1914 | + | |
| 1915 | + | |
| 1916 | + | |
| 1917 | + | |
| 1918 | + | |
| 1919 | + | |
| 1920 | + | |
| 1921 | + | |
| 1922 | + | |
| 1923 | + | |
| 1924 | + | |
| 1925 | + | |
| 1926 | + | |
| 1927 | + | |
| 1928 | + | |
| 1929 | + | |
| 1930 | + | |
| 1931 | + | |
| 1932 | + | |
| 1933 | + | |
| 1934 | + | |
| 1935 | + | |
| 1936 | + | |
| 1937 | + | |
| 1938 | + | |
| 1939 | + | |
| 1940 | + | |
| 1941 | + | |
| 1942 | + | |
| 1943 | + | |
| 1944 | + | |
| 1945 | + | |
| 1946 | + | |
| 1947 | + | |
| 1948 | + | |
| 1949 | + | |
| 1950 | + | |
| 1951 | + | |
| 1952 | + | |
| 1953 | + | |
| 1954 | + | |
| 1955 | + | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
| 1963 | + | |
| 1964 | + | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
| 1969 | + | |
| 1970 | + | |
| 1971 | + | |
| 1972 | + | |
| 1973 | + | |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
| 1977 | + | |
| 1978 | + | |
| 1979 | + | |
| 1980 | + | |
| 1981 | + | |
| 1982 | + | |
| 1983 | + | |
| 1984 | + | |
| 1985 | + | |
| 1986 | + | |
| 1987 | + | |
| 1988 | + | |
| 1989 | + | |
| 1990 | + | |
| 1991 | + | |
| 1992 | + | |
| 1993 | + | |
1914 | 1994 | | |
1915 | 1995 | | |
1916 | 1996 | | |
0 commit comments