Commit Graph
19 Commits
Author SHA1 Message Date
Kirill Bulatov f38f45b01d Better storage sync logs (#2268) 2022-08-13 10:58:14 +03:00
Dmitry Rodionov beaa991f81 remove debug log 2022-08-08 12:15:16 +03:00
Ankur Srivastava 84d1bc06a9 refactor: replace lazy-static with once-cell (#2195)
- Replacing all the occurrences of lazy-static with `once-cell::sync::Lazy`
- fixes #1147

Signed-off-by: Ankur Srivastava <best.ankur@gmail.com>
2022-08-05 19:34:04 +02:00
Dmitry Rodionov 5f71aa09d3 support running tests against real s3 implementation without mocking 2022-08-04 11:14:05 +03:00
Dmitry Rodionov 7987889cb3 keep successfully downloaded index parts 2022-07-18 12:27:04 +03:00
Dmitry Rodionov 912a08317b do not ignore errors during downloading of tenant index parts 2022-07-18 12:27:04 +03:00
Heikki Linnakangas a342957aee Use ok_or_else() instead of ok_or(), to silence clippy warnings.
"cargo clippy" started to complain about these, after running "cargo
update". Not sure why it didn't complain before, but seems reasonable to
fix these. (The "cargo update" is not included in this commit)
2022-07-14 22:13:51 +03:00
Dmitry Rodionov 9f2b40645d review cleanup, point timeline/detach to timeline/delete 2022-07-07 21:20:04 +03:00
Dmitry Rodionov d9d4ef12c3 review cleanup 2022-07-07 21:20:04 +03:00
Dmitry Rodionov e1e24336b7 review adjustments, bring back timeline_detach and rename it to timeline_delete 2022-07-07 21:20:04 +03:00
Dmitry Rodionov 4c54e4b37d switch to per-tenant attach/detach
download operations of all timelines for one tenant are now grouped
together so when attach is invoked pageserver downloads all of them
and registers them in a single apply_sync_status_update call so
branches can be used safely with attach/detach
2022-07-07 21:20:04 +03:00
Kirill Bulatov 50821c0a3c Return download stream directly from the remote storage API 2022-07-05 21:45:15 +03:00
Arthur Petukhovsky a01999bc4a Replace most common remote logs with metrics (#1909) 2022-06-08 13:36:49 +03:00
Kian-Meng Ang f1c51a1267 Fix typos 2022-05-28 14:02:05 +03:00
Heikki Linnakangas 55ea3f262e Fix race condition leading to panic in remote storage sync thread.
The SyncQueue consisted of a tokio mpsc channel, and an atomic counter
to keep track of how many items there are in the channel. Updating the
atomic counter was racy, and sometimes the consumer would decrement
the counter before the producer had incremented it, leading to integer
wraparound to usize::MAX. Calling Vec::with_capacity(usize::MAX) leads
to a panic.

To fix, replace the channel with a VecDeque protected by a Mutex, and
a condition variable for signaling. Now that the queue is now
protected by standard blocking Mutex and Condvar, refactor the
functions touching it to be sync, not async.

A theoretical downside of this is that the calls to push items to the
queue and the storage sync thread that drains the queue might now need
to wait, if another thread is busy manipulating the queue. I believe
that's OK; the lock isn't held for very long, and these operations are
made in background threads, not in the hot GetPage@LSN path, so
they're not very latency-sensitive.

Fixes #1719. Also add a test case.
2022-05-17 18:14:57 +03:00
Kirill Bulatov 0a7735a656 Rework remote storage sync queue, general refactoring 2022-05-07 01:33:33 +03:00
Kirill Bulatov 64a602b8f3 Delete timeline layers 2022-05-07 01:33:33 +03:00
Kirill Bulatov 10e4da3997 Rework timeline batching 2022-05-07 01:33:33 +03:00
Kirill Bulatov de37f982db Share the remote storage as a crate 2022-05-07 00:30:36 +03:00