0
0
mirror of https://github.com/tursodatabase/libsql.git synced 2025-05-17 10:06:58 +00:00

1667 Commits

Author SHA1 Message Date
f66dcf7948 fix dump import/export to support libsql-wal () 2024-06-06 20:03:55 +00:00
5ab7f12925 server: release v0.24.14 () 2024-06-05 18:28:37 +00:00
b694430619 categorize namespace doesnt exist error replicator ()
* add libsql-server to default-members

make `cargo run` run libsql-server by default

* return NOT_FOUND when replica query unexisting namespace
2024-06-05 16:53:34 +00:00
7668db8be4 server: fix hrana error classification ()
* server: fix hrana error classification

* add new test snapshots

* more snapshots
2024-06-05 16:34:12 +00:00
c3a44d61b5 server: release v0.24.13 () 2024-06-04 17:12:15 +00:00
2b9ad5ccbc server: fix stats sending performance and ns creation ()
* server: create debug logging

* server: fix stats sending performance

This change fixes how we send stats to the pulse server. This is done by
not serially sending stats on the same task that we extract events from.
The reason for this is that if the event buffer (stats_sender) gets full
it will block namespace create requests.

With this change, we now submit stats http requests off the main stats
task and restrict the stats sending to 128 concurrent requests. This
will allow us to accept more create namespace requests and efficiently
send stats.
2024-06-04 17:10:35 +00:00
97beabd9a2 fix shared schema replicatioon ()
* allow schema db replication

* load master schema first when replicating shared schema db
2024-06-04 16:01:18 +00:00
07a679e745 Generate Eitherxx variants ()
* Create a drop in replacement for `Either` with `Any`

* generate Eitherxx variants

* generate Eitherxx variants

---------

Co-authored-by: ad hoc <postma.marin@protonmail.com>
2024-06-04 12:35:00 +00:00
748e8e71d9 server: return 429 when dbcreatetimeout is hit () 2024-06-03 14:31:35 +00:00
5129bdb2a3 libsq wal integration ()
* integrate libsql-wal

* fix wal bug

* shutdown registry on shutdown

* fmt
2024-06-03 09:30:40 +00:00
093882cf00 server: prepare v0.24.12 release () 2024-05-29 13:42:06 +00:00
5021f9fb0c add session_token for AWS short-term credentials ()
Co-authored-by: Ryan Dsouza <r.dsouza@newmotion.com>
2024-05-29 13:23:23 +00:00
e451079c18 Allow single transaction in schema migration ()
* Return also Program from Connection::run

Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>

* Extract LibSqlConnection::execute

Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>

* Use LibSqlConnection::execute in write_proxy

Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>

* Remove Clone from Program

Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>

* Remove Arc from Program

Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>

* Allow a single transaction in schema migration

Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>

* fix rustc-hash dep issue

Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>

---------

Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>
2024-05-28 15:05:45 +00:00
9da7b2cb33 fix schema migration hang () 2024-05-23 12:27:25 +00:00
a439cb63cb bump libsql server to v0.24.11 () 2024-05-23 12:20:38 +00:00
21145e0b1b fix namespace bin header ()
* fix warning deprecated cargo config extension

* decode `x-namespace-bin`
2024-05-22 14:23:52 +00:00
15a280e29a bump libsql-server to 0.24.10 () 2024-05-22 14:22:40 +00:00
edb14ca4fb bump sqld to 0.24.9 () 2024-05-21 18:49:45 +00:00
0c730c439a Propagate schema migration errors correctly ()
* Update hecrj/setup-rust-action to v2

Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>

* Update rust-toolchain.toml to 1.78

Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>

* Propagate schema migration errors correctly

Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>

---------

Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>
2024-05-21 11:53:42 +00:00
1093eaf16b fix metastore deadlock ()
* non-blocking is_snapshotted

* prevent infinite blocking in bottomless wal

* finer grained locking in meta store to prevent deadlock

* review edits
2024-05-17 16:13:02 +00:00
4543558a40 Log checkpoint return status () 2024-05-16 17:22:08 +00:00
a494735e56 checkpoint metastore after every operation () 2024-05-15 13:59:42 +00:00
80db147b5c Add an admin endpoint to checkpoint () 2024-05-15 13:39:37 +00:00
922aebcbc9 bump libsql server v0.24.8 ()
* bump cargo dist

* bump libsql-server to 0.24.8
2024-05-14 12:36:07 +00:00
415df4da76 Log namespace id in the checkpoint logs () 2024-05-13 14:14:15 +00:00
4bbfda4108 Fix bottomless replication subproject link in libsql-server readme () 2024-05-10 16:59:55 +00:00
876e4ab232 server: return sec not millis for txn timeout () 2024-04-30 16:37:51 +00:00
3252b63c10 server: add config update txn_timeout ()
* server: add config update txn_timeout

* add txn_timeout config to conn manager
2024-04-30 14:39:29 +00:00
e37b644395 libsql-wal: SealedSegment ()
* add libsql-wal crate

* add error module

* segment module, header structs on helper functions

* sealed log

* add missing deps

* silence warnings

* segment list

* fmt

* fix lockfile

* fix bottomless because of conflict on cargo.lock

* document db size

* fix typo in comment

* fix proto
2024-04-26 11:10:54 +00:00
777012123d Stop holding lock during query execution ()
Holding a lock during query execution can lead to a deadlock if
the transaction holding it is blocked by another transaction and
that other transaction can't proceed because it can't get the lock
that is held by the first transaction.

Fixes 

Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>
2024-04-24 13:03:44 +00:00
8f96340eb0 server: parallelize namespace shutdown () 2024-04-23 06:35:51 +00:00
ca8834c053 Namespace passing in http header ()
* wip - passing userauthcontext instead of http headers

* revert comment out

* fixed temp change

* Merge branch 'main' into jw/changing-how-jwt-is-passed-around

* fixed failing tests

* next iteration of unit test fixing

* fixed remaining unit tests

* reverted debug

* removed accidentally added file

* moved str to userauthcontext conversion to from trait

* remove vague comment

* cargo fmt

* cleaned up mod reimportss

* refactored cryptic matching in replica_proxy

* marked potentially duplicate code with // todo dupe #auth

* refactored context to custome errors

* added a factory to produce empty UserAuthContext

* added constructors for UserAuthContext

* switched from try_into to using constructors

* cargo fmt

* added tests for failing cases in parsers

* adding mamespace as param wip

* cargo fmt

* added test for non-asci error

* incremental changes to make namespace as param work

* fixed failing test

* fixed log message

* removed unnecessary error mapping

* turned context to result

* removing dummy tokens from tests

* cargo fmt + cleanup

* namespace passing exammple

* added namespace config for the example

* remove unnecessary dummy token

* reverting accidental commit

* deduplicated handling of hrana hello and repreated hello. Code is fully equivalent to the previous form. No change in logic.

* fixed early return

* lazy unwrapping

* made session fields private again

* fmt

* cleaned up nesting in conn

* fmt

* refactored ns selection to be more expressive

* narrowed the type constraints for namespace arg

* restructured namespace_from_headers

* rearranged the logic of selecting namespace passing method

* fmt

* simplified type

* further refinement of namespace selection logic

* reverted unnecessary change

* reverted unnecessary change

* fmt

* added documentation

* Fix simple queries for schema databases ()

* server: release v0.24.5 ()

* libsql: fix embedded replica multiple txn ()

This commit fixes an issue where new connections for embedded replica's
with write delegation would not create a new "connection" on the server
causing weird issues with transactions and state. The fix here is to
create a new `client_id` when creating a new writer for a new connection
locally. This forces the server to use separate connections to execute
the writes.

Closes 

* libsql: prepare v0.3.3 release ()

* Go updates ()

* Go bindings: Improve imports

Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>

* Go bindings: continue Next() after a time.Time

Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>

* Go bindings: remove unused err check

Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>

---------

Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>

* Remove in-tree version of go-libsql ()

* Go bindings: build only sql-experimental for CI

Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>

* Go bindings: Run go-libsql tests in CI

Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>

* Go bindings: Remove in-tree version of go-libsql

go-libsql is maintained in https://github.com/tursodatabase/go-libsql

Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>

* Go bindings: Run more tests in CI

Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>

---------

Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>

* don't regen log on sqld version mismatch ()

* add debug info to release build ()

* Add 'aarch64-unknown-linux-gnu' to dist targets ()

* bump sqld v0.24.6 ()

* Bump arm builder machine ()

Builds of arm images are hanging/crashing

* Revert "add debug info to release build ()" ()

This reverts commit 342e4c368b.

* bottomless: upgrade s3 sdk to 1.0 ()

* bottomless: upgrade s3 sdk to 1.0

* fix behavior version

* libsql: fix embedded replica example ()

* server: add query stats to hrana responses ()

* server: add query stats to hrana responses

* update spec with stats

* remove unused import

* fix snapshot

* more snapshots

* add stats to legacy api

* address comments

* update tonic to 0.11 ()

* Add workflow_dispatch event trigger for PR images ()

* Fix sync ()

Old implementation could never finish if the write is faster than
time needed to do two round-trips to primary.

For example it's enough to have a write every 200ms to make sync
never finish if it's done in embedded replica in Sydney
if the primary and the writer are in the US.

Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>

* server: add `query_duration_ms` stats to query res ()

* server: add `query_duration_ms` stats to query res

* hrana: default new stats fields

* libsql: fix unwraps in local replicas ()

* server: release v0.24.7 ()

* cargo lock update

* Revert "cargo lock update"

This reverts commit a86b89d8bc.

---------

Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>
Co-authored-by: Julian <julian@Julians-MacBook-Pro.local>
Co-authored-by: Athos <athos@turso.tech>
Co-authored-by: Lucio Franco <luciofranco14@gmail.com>
Co-authored-by: Piotr Jastrzębski <haaawk@gmail.com>
Co-authored-by: ad hoc <postma.marin@protonmail.com>
Co-authored-by: Pekka Enberg <penberg@iki.fi>
Co-authored-by: Avinash Sajjanshetty <640792+avinassh@users.noreply.github.com>
2024-04-22 18:47:26 +00:00
f26baff7b4 use user query string for queries rather than generated () 2024-04-19 17:26:30 +00:00
85775d4595 fix unused blocking rt () 2024-04-17 15:35:27 +00:00
20f56ad4a2 server: release v0.24.7 () 2024-04-16 18:27:37 +00:00
7708a43772 server: add query_duration_ms stats to query res ()
* server: add `query_duration_ms` stats to query res

* hrana: default new stats fields
2024-04-15 16:37:13 +00:00
505b21f536 Fix sync ()
Old implementation could never finish if the write is faster than
time needed to do two round-trips to primary.

For example it's enough to have a write every 200ms to make sync
never finish if it's done in embedded replica in Sydney
if the primary and the writer are in the US.

Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>
2024-04-15 14:31:15 +00:00
15fe600c40 update tonic to 0.11 () 2024-04-11 17:54:36 +00:00
dac888bbb7 server: add query stats to hrana responses ()
* server: add query stats to hrana responses

* update spec with stats

* remove unused import

* fix snapshot

* more snapshots

* add stats to legacy api

* address comments
2024-04-11 16:23:21 +00:00
38da8f7d8c bump sqld v0.24.6 () 2024-04-10 10:41:35 +00:00
87d0145408 don't regen log on sqld version mismatch () 2024-04-09 17:48:48 +00:00
958f5613cc libsql: fix embedded replica multiple txn ()
This commit fixes an issue where new connections for embedded replica's
with write delegation would not create a new "connection" on the server
causing weird issues with transactions and state. The fix here is to
create a new `client_id` when creating a new writer for a new connection
locally. This forces the server to use separate connections to execute
the writes.

Closes 
2024-04-05 20:44:31 +00:00
fa98db3c04 server: release v0.24.5 () 2024-04-05 20:14:29 +00:00
59b922b294 Fix simple queries for schema databases () 2024-04-05 19:57:06 +00:00
724f6db925 libsql: fix malformed db and add test ()
* add malformed db test

* continue to debug output sql

* reduce sql

* reset connection on injection

* remove println in test

* address comments
2024-04-04 18:20:17 +00:00
00080c5983 server: add embedded replica stats test for replica () 2024-04-01 20:22:31 +00:00
9bb9cd4753 Add more logging in case snapshots fail ()
We have a user with a failing snapshot, but we don't know why.
We know rename returns EINVAL, which could happen for a variety
of reasons, all of them related to the paths themselves.

By printing the path, we will be able to figure out the actual reason.
Right now we're shooting in the dark.
2024-04-01 16:13:14 +00:00
6fc29fcc5c Dedupe Hrana hello and repeated hello ()
* deduplicated handling of hrana hello and repreated hello. Code is fully equivalent to the previous form. No change in logic.

* fixed early return

* lazy unwrapping

* made session fields private again

* fmt

* cleaned up nesting in conn

* fmt
2024-03-30 13:41:20 +00:00
fb647000a9 don't capture script output in scripted backup () 2024-03-28 15:06:37 +00:00
5cfb62f580 pass logid to backup script () 2024-03-27 17:05:24 +00:00