Commit Graph

52 Commits

Author SHA1 Message Date
Alex Auvolat 913e6da41b admin api: implement PreviewClusterLayoutChanges 2025-03-06 17:27:23 +01:00
Alex Auvolat e4881e62f1 admin api: management of layout parameters through admin api 2025-03-06 17:12:52 +01:00
Alex Auvolat 2e03d90585 admi api: remove info about local node from GetClusterStatus and add specific GetNodeInfo endpoint 2025-03-06 10:26:01 +01:00
Alex Auvolat 7c8fc04b96 massively speed up compilation of garage_api_admin by not using async_trait 2025-02-05 19:37:38 +01:00
Alex Auvolat 89ff9f5576 admin api: base infrastructure for local endpoints
admin api: rename EndpointHandler into RequestHandler to avoid confusion with RPC

wip: infrastructure for local api calls

admin api: fix things

admin api: first local endpoint to work with new scheme

admin api: implement SetWorkerVariable
2025-02-03 18:54:51 +01:00
Alex Auvolat fe937c2901 Merge branch 'main' into next-v2 2025-02-01 19:07:17 +01:00
Alex Auvolat 84f1db91c4 fix things up 2025-01-31 18:34:57 +01:00
Alex Auvolat 9fa20d45be wip: split garage_api into garage_api_{common,s3,k2v,admin} 2025-01-31 18:18:29 +01:00
Alex Auvolat 4f0b923c4f admin api: small fixes 2025-01-29 19:26:16 +01:00
Alex Auvolat 420bbc162d admin api: clearer syntax for AddBucketAlias and RemoveBucketAlias 2025-01-29 19:26:16 +01:00
Alex Auvolat f538dc34d3 admin api: make all requests and responses (de)serializable 2025-01-29 19:26:16 +01:00
Alex Auvolat 831f2b0207 admin api: make all handlers impls of a single trait 2025-01-29 19:26:16 +01:00
Alex Auvolat c1eb1610ba admin api: create structs for all requests/responess in src/api/admin/api.rs 2025-01-29 19:26:16 +01:00
Alex Auvolat 25c196f34d [next-0.10] admin api: fix logic in get cluster status 2024-03-27 13:55:49 +01:00
Alex Auvolat 01a0bd5410 [next-0.10] remove impl Deref for LayoutHelper 2024-03-27 13:32:13 +01:00
Alex Auvolat 961b4f9af3 [net-fixes] fix issues with local peer address (fix #761) 2024-03-21 10:45:34 +01:00
Alex Auvolat cf2af186fc Merge branch 'main' into next-0.10 2024-02-13 11:36:28 +01:00
Alex Auvolat a22bd31920 [dep-upgrade-202402] migration to http/hyper 1.0 for k2v api 2024-02-05 19:27:12 +01:00
Alex Auvolat 0bb5b77530 [dep-upgrade-202402] wip: port to http/hyper crates v1 2024-02-05 18:49:54 +01:00
Alex Auvolat 85b5a6bcd1 fix some clippy lints 2023-12-11 15:31:47 +01:00
Alex Auvolat c04dd8788a admin: more info in admin GetClusterStatus 2023-11-28 14:25:04 +01:00
Alex Auvolat 393c4d4515 layout: add helper for cached/external values to centralize recomputation 2023-11-15 14:20:50 +01:00
Alex Auvolat bad7cc812e layout admin: add missing calls to update_hash 2023-11-09 15:42:10 +01:00
Alex Auvolat bfb1845fdc layout: refactor to use a RwLock on LayoutHistory 2023-11-09 14:12:05 +01:00
Alex Auvolat 8a2b1dd422 wip: split out layout management from System into separate LayoutManager 2023-11-09 12:55:36 +01:00
Alex Auvolat 523d2ecb95 layout: use separate CRDT for staged layout changes 2023-11-09 11:19:43 +01:00
Alex Auvolat 8dccee3ccf cluster layout: adapt all uses of ClusterLayout to LayoutHistory 2023-11-08 19:28:36 +01:00
Alex Auvolat 4a9c94514f avoid using layout_watch in System directly 2023-11-08 16:41:00 +01:00
Alex Auvolat 8ef42c9609 admin docs: reformatting, key admin: add check 2023-06-14 17:19:25 +02:00
Alex Auvolat a83a092c03 admin: uniformize layout api and improve code 2023-06-14 17:12:37 +02:00
Alex Auvolat 35c108b85d admin api: switch GetClusterHealth to camelcase (fix #381 again) 2023-06-14 13:53:19 +02:00
Alex Auvolat 52376d47ca admin api: change cluster status/layout to use lists and not maps (fix #377) 2023-06-14 13:45:27 +02:00
Alex Auvolat bf19a44fd9 admin API: add missing camelCase conversions (fix #381) 2023-06-13 16:15:50 +02:00
Alex Auvolat fa78d806e3 Merge branch 'main' into next 2023-04-25 12:34:26 +02:00
Jonathan Davies 9ea154ae9c admin/cluster.rs: Added rust_version. 2023-03-10 14:46:54 +00:00
Alex Auvolat 2c2e65ad8b Merge commit 'ec12d6c' into next 2022-12-11 18:41:15 +01:00
Alex Auvolat 533afcf4e1 simplify 2022-12-11 18:17:08 +01:00
Alex Auvolat 5ea5fd2130 Always return 200 OK on /v0/health, reinstate admin api doc as draft and complete it 2022-12-11 18:11:28 +01:00
Alex Auvolat d7868c48a4 Separate /health (simple text answer) and /v0/health (full json answer, authenticated) 2022-12-05 15:38:32 +01:00
Alex Auvolat 217abdca18 Fix HTTP return code 2022-11-08 15:38:53 +01:00
Alex Auvolat d75b37b018 Return more info when layout's .check() fails, fix compilation, fix test 2022-11-08 14:58:39 +01:00
Alex Auvolat ea5afc2511 Style improvements 2022-11-07 20:11:30 +01:00
Alex Auvolat 28d7a49f63 Merge branch 'main' into optimal-layout 2022-11-07 12:20:59 +01:00
Tobias Krischer 7865003323 Use status code 204 No Content for empty responses 2022-10-17 10:55:26 +02:00
Mendes 4abab246f1 cargo fmt 2022-10-10 17:21:13 +02:00
Mendes ceac3713d6 modifications in several files to :
- have consistent error return types
- store the zone redundancy in a Lww
- print the error and message in the CLI (TODO: for the server Api, should msg be returned in the body response?)
2022-10-05 15:29:48 +02:00
Alex Auvolat ceb1f0229a Move version back into util 2022-09-07 18:36:46 +02:00
Alex Auvolat 28d86e7602 Report build features in garage --help 2022-09-07 17:05:21 +02:00
Alex Auvolat db61f41030 Move GIT_VERSION injection later in build chain to reduce build times 2022-09-07 11:59:56 +02:00
Alex b44d3fc796 Abstract database behind generic interface and implement alternative drivers (#322)
- [x] Design interface
- [x] Implement Sled backend
  - [x] Re-implement the SledCountedTree hack ~~on Sled backend~~ on all backends (i.e. over the abstraction)
- [x] Convert Garage code to use generic interface
- [x] Proof-read converted Garage code
- [ ] Test everything well
- [x] Implement sqlite backend
- [x] Implement LMDB backend
- [ ] (Implement Persy backend?)
- [ ] (Implement other backends? (like RocksDB, ...))
- [x] Implement backend choice in config file and garage server module
- [x] Add CLI for converting between DB formats
- Exploit the new interface to put more things in transactions
  - [x] `.updated()` trigger on Garage tables

Fix #284

**Bugs**

- [x] When exporting sqlite, trees iterate empty??
- [x] LMDB doesn't work

**Known issues for various back-ends**

- Sled:
  - Eats all my RAM and also all my disk space
  - `.len()` has to traverse the whole table
  - Is actually quite slow on some operations
  - And is actually pretty bad code...
- Sqlite:
  - Requires a lock to be taken on all operations. The lock is also taken when iterating on a table with `.iter()`, and the lock isn't released until the iterator is dropped. This means that we must be VERY carefull to not do anything else inside a `.iter()` loop or else we will have a deadlock! Most such cases have been eliminated from the Garage codebase, but there might still be some that remain. If your Garage-over-Sqlite seems to hang/freeze, this is the reason.
  - (adapter uses a bunch of unsafe code)
- Heed (LMDB):
  - Not suited for 32-bit machines as it has to map the whole DB in memory.
  - (adpater uses a tiny bit of unsafe code)

**My recommendation:** avoid 32-bit machines and use LMDB as much as possible.

**Converting databases** is actually quite easy. For example from Sled to LMDB:

```bash
cd src/db
cargo run --features cli --bin convert -- -i path/to/garage/meta/db -a sled -o path/to/garage/meta/db.lmdb -b lmdb
```

Then, just add this to your `config.toml`:

```toml
db_engine = "lmdb"
```

Co-authored-by: Alex Auvolat <alex@adnab.me>
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/322
Co-authored-by: Alex <alex@adnab.me>
Co-committed-by: Alex <alex@adnab.me>
2022-06-08 10:01:44 +02:00