Commit graph

110 commits

Author SHA1 Message Date
Antonio Scandurra
05ec6b89c2 WIP 2023-07-30 13:45:31 +02:00
Antonio Scandurra
93701f9c5d Avoid incrementing operation id if it's unnecessary for causality 2023-07-30 12:15:34 +02:00
Antonio Scandurra
083bfc6cbc Reify a History struct
This has to be integrated still.
2023-07-30 11:57:02 +02:00
Antonio Scandurra
a084a93ef0 Make apply_operations asynchronous 2023-07-29 15:36:52 +02:00
Antonio Scandurra
84bf6c5a16 Use pointer equality to detect changes to the repo snapshot 2023-07-29 11:54:13 +02:00
Antonio Scandurra
e99f82f855 Start on loading/saving revisions 2023-07-29 11:54:02 +02:00
Antonio Scandurra
ba3353d127 Allow loading and saving of ropes
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2023-07-28 19:58:31 +02:00
Antonio Scandurra
2887c4674d Load fewer items in randomized tests for partially loaded trees 2023-07-28 19:57:03 +02:00
Antonio Scandurra
22e8a67498 Load branch from kv store if necessary
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2023-07-28 19:14:58 +02:00
Antonio Scandurra
4848ea8e62 Spawn a background task to save repo snapshots 2023-07-28 13:08:33 +02:00
Antonio Scandurra
3349f2147a Force all changes to a repository to take place via Repo::update 2023-07-28 12:45:51 +02:00
Antonio Scandurra
103d5293be Start on loading RepoSnapshots 2023-07-28 12:34:23 +02:00
Antonio Scandurra
1046b60fd2 Avoid cycling dependency between Client and Checkout 2023-07-28 11:15:49 +02:00
Antonio Scandurra
d5932717f2 WIP 2023-07-27 19:41:56 +02:00
Antonio Scandurra
8eeaacdf0a Pass a KvStore to Client and Server
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-07-27 18:03:55 +02:00
Antonio Scandurra
2de48f96d2 Simplify KvStore trait
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-07-27 17:49:16 +02:00
Antonio Scandurra
ba42db7069 Fix test for slice and summary to account for partial trees 2023-07-27 13:01:01 +02:00
Antonio Scandurra
32c8eb2612 Correctly maintain cursor stack position when ascending in seek 2023-07-27 12:33:13 +02:00
Antonio Scandurra
d277e214bd Re-enable randomized tests for cursor movement in partially-loaded trees 2023-07-27 12:32:07 +02:00
Antonio Scandurra
cbc5dc04ef Avoid pushing empty leaves into the tree 2023-07-27 12:28:26 +02:00
Antonio Scandurra
198be71b6c Fix panic due to accidentally descending into unloaded node in cursor 2023-07-27 09:53:31 +02:00
Antonio Scandurra
5eede853f6 Don't call push_tree_recursive on leaf when appending unloaded node 2023-07-27 09:52:17 +02:00
Antonio Scandurra
7282629f93 Ensure that loading the full tree is equivalent to the reference items 2023-07-26 18:05:06 +02:00
Antonio Scandurra
517591bced Load the relevant nodes before splicing in randomized test 2023-07-26 18:02:04 +02:00
Antonio Scandurra
4c5e248693 Start on a randomized test for persistence 2023-07-26 17:12:09 +02:00
Antonio Scandurra
b8066d444a Allow keeping nodes in the tree when pruning 2023-07-26 17:11:58 +02:00
Antonio Scandurra
f8cf74f9e8 Introduce InMemoryKv to test persistence 2023-07-26 16:50:28 +02:00
Antonio Scandurra
97cdad7f1a Implement Sequence::prune 2023-07-26 16:41:45 +02:00
Antonio Scandurra
1b803e498f Implement Sequence::load to selectively load subtrees 2023-07-26 15:57:49 +02:00
Antonio Scandurra
7a851d42ad Add a Sequence::from_root function 2023-07-26 15:41:32 +02:00
Antonio Scandurra
18412c3a06 Introduce ChildTree to identify loaded or unloaded subtrees 2023-07-26 13:41:31 +02:00
Antonio Scandurra
6e8b207104 Implement Sequence::save 2023-07-26 10:09:24 +02:00
Antonio Scandurra
3c3bf793e3 Rename SeekTarget::cmp to SeekTarget::seek_cmp
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-07-25 18:07:01 +02:00
Antonio Scandurra
ca57c1839c Fork crdb-specific copies of rope and sum_tree (renamed to btree)
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-07-25 18:04:28 +02:00
Antonio Scandurra
f3928c8c26 Allow cloning of repos to fail
Co-Authored-By: Julia Risley <julia@zed.dev>
2023-07-25 16:31:16 +02:00
Antonio Scandurra
94f7ddbcb2 Allow saving and loading of test plans for randomized test in CRDB
Co-Authored-By: Julia Risley <julia@zed.dev>
2023-07-25 16:20:01 +02:00
Antonio Scandurra
369d85b82e Print RepoId as a number in tests
We are not going to generate repository ids randomly, so we can
take advantage of that and print a nicer representation of
the repository id.

Co-Authored-By: Julia Risley <julia@zed.dev>
2023-07-25 15:33:14 +02:00
Antonio Scandurra
cbdb83fb43 Extract test operation generation and application into methods
Co-Authored-By: Julia Risley <julia@zed.dev>
2023-07-25 15:25:54 +02:00
Antonio Scandurra
e9342e1b47 Deterministically assign repo IDs in tests 2023-07-25 15:10:16 +02:00
Antonio Scandurra
88829dfe21 Use test-support feature for collections in dev 2023-07-25 15:10:13 +02:00
Antonio Scandurra
1ada3722e5 Avoid creating empty document fragments 2023-07-25 12:40:50 +02:00
Antonio Scandurra
1e644b7a45 Keep insertion fragments up-to-date 2023-07-25 12:02:13 +02:00
Antonio Scandurra
eb36bc5b62 Use preceding fragment when edit starts at the beginning of a fragment 2023-07-25 11:27:43 +02:00
Antonio Scandurra
31f84cef14 Broadcast operations when synchronizing with the server 2023-07-25 10:05:59 +02:00
Antonio Scandurra
9358958b1f Observe lamport timestamps when applying operations 2023-07-25 09:58:38 +02:00
Antonio Scandurra
bbe126818f Avoid skipping sentinel as it'll happen organically when applying edit 2023-07-25 09:51:56 +02:00
Antonio Scandurra
7d02462abd Broadcast operations only after server acknowledges them
There was a test failure that was caused by the following sequence of
events:

1. Client 1 generates an operation and broadcasted it.
2. Client 2 joins, but it was too late to receive the operation from the network.
3. Client 2 synchronizes with the server, but it was too early to receive
operations from the server.
4. Client 1 finally sends the operation to the server.
2023-07-24 17:53:01 +02:00
Antonio Scandurra
fa48d59de4 Generate edit operation correctly when range is at the end of fragment 2023-07-24 16:55:17 +02:00
Antonio Scandurra
439f6ba616 Use end fragment to determine the new insertion's fragment location 2023-07-24 16:46:43 +02:00
Antonio Scandurra
729ea89fef Create room before inserting repo into database
This ensures that clones of the repo will either see the repo and
be able to join the room, or not see the repo at all.
2023-07-24 16:40:09 +02:00