2023-04-14 21:18:58 +02:00
|
|
|
[workspace]
|
2023-06-12 10:04:35 +02:00
|
|
|
members = [
|
2023-07-14 21:44:08 +02:00
|
|
|
"atuin",
|
|
|
|
"atuin-client",
|
|
|
|
"atuin-server",
|
|
|
|
"atuin-server-postgres",
|
|
|
|
"atuin-server-database",
|
2024-02-15 20:07:08 +01:00
|
|
|
"atuin-common",
|
|
|
|
"atuin-config",
|
2023-06-12 10:04:35 +02:00
|
|
|
]
|
2023-04-14 21:18:58 +02:00
|
|
|
|
2024-01-26 18:59:06 +01:00
|
|
|
resolver = "2"
|
|
|
|
|
2023-04-14 21:18:58 +02:00
|
|
|
[workspace.package]
|
2024-02-26 12:37:54 +01:00
|
|
|
version = "18.0.2"
|
2021-04-20 22:53:07 +02:00
|
|
|
authors = ["Ellie Huxtable <ellie@elliehuxtable.com>"]
|
2023-09-11 10:26:05 +02:00
|
|
|
rust-version = "1.67"
|
2020-10-05 02:06:41 +02:00
|
|
|
license = "MIT"
|
2021-04-21 22:32:21 +02:00
|
|
|
homepage = "https://atuin.sh"
|
2023-07-31 00:08:00 +02:00
|
|
|
repository = "https://github.com/atuinsh/atuin"
|
2021-04-26 15:25:57 +02:00
|
|
|
readme = "README.md"
|
|
|
|
|
2023-04-14 21:18:58 +02:00
|
|
|
[workspace.dependencies]
|
|
|
|
async-trait = "0.1.58"
|
|
|
|
base64 = "0.21"
|
2021-02-14 19:40:51 +01:00
|
|
|
log = "0.4"
|
2023-10-25 20:06:59 +02:00
|
|
|
time = { version = "0.3", features = [
|
|
|
|
"serde-human-readable",
|
|
|
|
"macros",
|
|
|
|
"local-offset",
|
|
|
|
] }
|
2023-04-14 21:18:58 +02:00
|
|
|
clap = { version = "4.0.18", features = ["derive"] }
|
|
|
|
config = { version = "0.13", default-features = false, features = ["toml"] }
|
2023-12-16 20:20:40 +01:00
|
|
|
directories = "5.0.1"
|
2023-04-14 21:18:58 +02:00
|
|
|
eyre = "0.6"
|
|
|
|
fs-err = "2.9"
|
2023-09-11 10:26:05 +02:00
|
|
|
interim = { version = "0.1.0", features = ["time"] }
|
2023-12-16 20:20:40 +01:00
|
|
|
itertools = "0.12.0"
|
2023-04-14 21:18:58 +02:00
|
|
|
rand = { version = "0.8.5", features = ["std"] }
|
2023-10-18 00:39:47 +02:00
|
|
|
semver = "1.0.20"
|
2023-12-16 20:20:40 +01:00
|
|
|
serde = { version = "1.0.193", features = ["derive"] }
|
2023-12-09 18:40:22 +01:00
|
|
|
serde_json = "1.0.108"
|
2021-04-20 18:07:11 +02:00
|
|
|
tokio = { version = "1", features = ["full"] }
|
2023-12-16 20:21:04 +01:00
|
|
|
uuid = { version = "1.3", features = ["v4", "v7", "serde"] }
|
2022-04-22 22:05:02 +02:00
|
|
|
whoami = "1.1.2"
|
2023-12-16 20:20:40 +01:00
|
|
|
typed-builder = "0.18.0"
|
2023-07-14 21:44:08 +02:00
|
|
|
pretty_assertions = "1.3.0"
|
feat: rework record sync for improved reliability (#1478)
* feat: rework record sync for improved reliability
So, to tell a story
1. We introduced the record sync, intended to be the new algorithm to
sync history.
2. On top of this, I added the KV store. This was intended as a simple
test of the record sync, and to see if people wanted that sort of
functionality
3. History remained syncing via the old means, as while it had issues it
worked more-or-less OK. And we are aware of its flaws
4. If KV syncing worked ok, history would be moved across
KV syncing ran ok for 6mo or so, so I started to move across history.
For several weeks, I ran a local fork of Atuin + the server that synced
via records instead.
The record store maintained ordering via a linked list, which was a
mistake. It performed well in testing, but was really difficult to debug
and reason about. So when a few small sync issues occured, they took an
extremely long time to debug.
This PR is huge, which I regret. It involves replacing the "parent"
relationship that records once had (pointing to the previous record)
with a simple index (generally referred to as idx). This also means we
had to change the recordindex, which referenced "tails". Tails were the
last item in the chain.
Now that we use an "array" vs linked list, that logic was also replaced.
And is much simpler :D
Same for the queries that act on this data.
----
This isn't final - we still need to add
1. Proper server/client error handling, which has been lacking for a
while
2. The actual history implementation on top
This exists in a branch, just without deletions. Won't be much to
add that, I just don't want to make this any larger than it already
is
The _only_ caveat here is that we basically lose data synced via the old
record store. This is the KV data from before.
It hasn't been deleted or anything, just no longer hooked up. So it's
totally possible to write a migration script. I just need to do that.
* update .gitignore
* use correct endpoint
* fix for stores with length of 1
* use create/delete enum for history store
* lint, remove unneeded host_id
* remove prints
* add command to import old history
* add enable/disable switch for record sync
* add record sync to auto sync
* satisfy the almighty clippy
* remove file that I did not mean to commit
* feedback
2024-01-05 18:57:49 +01:00
|
|
|
thiserror = "1.0"
|
2024-01-17 20:49:06 +01:00
|
|
|
rustix = {version = "0.38.30", features=["process", "fs"]}
|
2023-03-31 23:57:37 +02:00
|
|
|
|
2023-04-14 21:18:58 +02:00
|
|
|
[workspace.dependencies.reqwest]
|
|
|
|
version = "0.11"
|
2023-04-16 13:25:48 +02:00
|
|
|
features = ["json", "rustls-tls-native-roots"]
|
2022-04-21 19:07:33 +02:00
|
|
|
default-features = false
|
2023-04-14 21:18:58 +02:00
|
|
|
|
|
|
|
[workspace.dependencies.sqlx]
|
2023-11-29 10:30:34 +01:00
|
|
|
version = "0.7.3"
|
2023-10-25 20:06:59 +02:00
|
|
|
features = ["runtime-tokio-rustls", "time", "postgres", "uuid"]
|