Commit Graph

3658 Commits

Author SHA1 Message Date
Joonas Koivunen
b65cb8ea05 storage_layer: we no longer clone for residency change 2023-08-28 12:42:28 +03:00
Joonas Koivunen
3a7efc10a0 timeline: cleanup unused imports 2023-08-28 12:42:28 +03:00
Joonas Koivunen
a682de1dba Timeline: get_value_reconstruct_data: avoid warnings 2023-08-28 12:42:28 +03:00
Joonas Koivunen
45a542c335 tenant: pub(crate) 2023-08-28 12:42:28 +03:00
Joonas Koivunen
bdb98b288e ==== reprocessed 2023-08-28 12:42:28 +03:00
Joonas Koivunen
a06c8e9add inmemory_layer: drop impl Layer 2023-08-28 12:42:28 +03:00
Joonas Koivunen
18eefd61eb inmemory_layer: less warnings 2023-08-28 12:42:28 +03:00
Joonas Koivunen
a2de0574b5 inmemorylayer: flush integration, partial? 2023-08-28 12:42:28 +03:00
Joonas Koivunen
aa8e954197 layer_manager, layer_access_stats: remove witness sidequest
it was interfering with me moving responsibilities back and forth
2023-08-28 12:42:28 +03:00
Joonas Koivunen
30847e59b9 remove remote_layer instead of keep fixing 2023-08-28 12:42:28 +03:00
Joonas Koivunen
d930a581f8 layer_manager: compaction changes 2023-08-28 12:42:28 +03:00
Joonas Koivunen
931c22545b compaction: clippies 2023-08-28 12:42:28 +03:00
Joonas Koivunen
366f3c8ff8 compaction: reflect LayerE now managing remote client 2023-08-28 12:42:28 +03:00
Joonas Koivunen
26c39d7b4c timeline: pub(crate) compaction 2023-08-28 12:42:28 +03:00
Joonas Koivunen
6ffa5138ce compaction: upload index on success
otherwise test_gc_of_remote_layers fails
2023-08-28 12:42:28 +03:00
Joonas Koivunen
975e1558cc compaction: integration 2023-08-28 12:42:28 +03:00
Joonas Koivunen
82a955ebfe layer_manager: resident layer flush l0 changes 2023-08-28 12:42:28 +03:00
Joonas Koivunen
82596f8807 delta_layer: reflect non-async LayerE::for_written 2023-08-28 12:42:28 +03:00
Joonas Koivunen
e3e57579a1 integrate: download_all_layers
this time around with graceful cancellation.
2023-08-28 12:42:28 +03:00
Joonas Koivunen
56d551e6a3 ==== reprocessed 2023-08-28 12:42:28 +03:00
Joonas Koivunen
b4a0f8baf7 integrate: Timeline::get_value_reconstruct_data 2023-08-28 12:42:28 +03:00
Joonas Koivunen
2e686ed6ea eviction: integration
- evictiontask: remove unused imports
- eviction_task and dube: cleanup
- timeline: pub(crate) eviction
- timeline: adjust to "layere: adjust eviction"
- test: remove layer_eviction_aba_fails because it can no longer happen
- test: fix up evicts later test with ability to await for eviction
- eviction_task: more unused imports
- eviction: clippy
- eviction_task: more clippy
- fixup eviction: docs
- eviction: hold only Arc<Layer> after checking downloadedness
- refactor earlier eviction: use drop_eviction_guard instead
- dube: evict in spawned tasks
- timeline, eviction: evict in spawned
- eviction: add more errors
- evict_layers: remove witness
- eviction: post-witness forgotten panic
- eviction: remove blog references
2023-08-28 12:42:28 +03:00
Joonas Koivunen
c46f72d411 create_image_layers integration (multifile) 2023-08-28 12:42:28 +03:00
Joonas Koivunen
ed46713e5c remote_timeline_client: pub(crate) on upload 2023-08-28 12:42:28 +03:00
Joonas Koivunen
c228cb7b3f remote_timeline_client: continued integration work post ResidentLayer 2023-08-28 12:42:28 +03:00
Joonas Koivunen
c88e4a0974 layer_manager: integration 2023-08-28 12:42:28 +03:00
Joonas Koivunen
b71a2f4cb2 load_layer_map: integration 2023-08-28 12:42:23 +03:00
Joonas Koivunen
98a7b090de ========= layere 2023-08-28 12:41:31 +03:00
Joonas Koivunen
235a8cbd28 wip: LayerE 2023-08-28 12:41:31 +03:00
Joonas Koivunen
6afeb3c6f7 ========= unrelated 2023-08-28 12:41:31 +03:00
Joonas Koivunen
8c42aeac9f test: move log to assert message 2023-08-28 12:41:31 +03:00
Joonas Koivunen
f36658ac10 layerdesc: add from_filename 2023-08-28 12:41:31 +03:00
Joonas Koivunen
f8227da9da unrelated: layer_manager: avoid arc cloning 2023-08-28 12:41:31 +03:00
Joonas Koivunen
fbcd174489 load_layer_map: schedule deletions for any future layers (#5103)
Unrelated fixes noticed while integrating #4938.

- Stop leaking future layers in remote storage
- We schedule extra index_part uploads if layer name to be removed was
not actually present
2023-08-28 10:51:49 +03:00
Felix Prasanna
7b5489a0bb compute_ctl: start pg in cgroup for vms (#4920)
Starts `postgres` in cgroup directly from `compute_ctl` instead of from
`vm-builder`. This is required because the `vm-monitor` cannot be in the
cgroup it is managing. Otherwise, it itself would be frozen when
freezing the cgroup.

Requires https://github.com/neondatabase/cloud/pull/6331, which adds the
`AUTOSCALING` environment variable letting `compute_ctl` know to start
`postgres` in the cgroup.

Requires https://github.com/neondatabase/autoscaling/pull/468, which
prevents `vm-builder` from starting the monitor and putting postgres in
a cgroup. This will require a `VM_BUILDER_VERSION` bump.
2023-08-25 15:59:12 -04:00
Felix Prasanna
40268dcd8d monitor: fix filecache calculations (#5112)
## Problem
An underflow bug in the filecache calculations.

## Summary of changes
Fixed the bug, cleaned up calculations in general.
2023-08-25 13:29:10 -04:00
Vadim Kharitonov
4436c84751 Change codeowners (#5109) 2023-08-25 19:48:16 +03:00
John Spray
b758bf47ca pageserver: refactor TimelineMetadata serialization in IndexPart (#5091)
## Problem

The `metadata_bytes` field of IndexPart required explicit
deserialization & error checking everywhere it was used -- there isn't
anything special about this structure that should prevent it from being
serialized & deserialized along with the rest of the structure.

## Summary of changes

- Implement Serialize and Deserialize for TimelineMetadata
- Replace IndexPart::metadata_bytes with a simpler `metadata`, that can
be used directly.

---------

Co-authored-by: Arpad Müller <arpad-m@users.noreply.github.com>
2023-08-25 16:16:20 +01:00
Felix Prasanna
024e306f73 monitor: improve logging (#5099) 2023-08-25 10:09:53 -04:00
Alek Westover
f71c82e5de remove obsolete need dependency (#5087) 2023-08-25 09:10:26 -04:00
Conrad Ludgate
faf070f288 proxy: dont return connection pending (#5107)
## Problem

We were returning Pending when a connection had a notice/notification
(introduced recently in #5020). When returning pending, the runtime
assumes you will call `cx.waker().wake()` in order to continue
processing.

We weren't doing that, so the connection task would get stuck

## Summary of changes

Don't return pending. Loop instead
2023-08-25 15:08:45 +03:00
Arpad Müller
8c13296add Remove BlockReader::read_blk in favour of BlockCursor (#5015)
## Problem

We want to make `read_blk` an async function, but outside of
`async_trait`, which allocates, and nightly features, we can't use async
fn's in traits.

## Summary of changes

* Remove all uses of `BlockReader::read_blk` in favour of using block
  cursors, at least where the type of the `BlockReader` is behind a
  generic
* Introduce a `BlockReaderRef` enum that lists all implementors of
  `BlockReader::read_blk`.
* Remove `BlockReader::read_blk` and move its implementations into
  inherent functions on the types instead.

We don't turn `read_blk` into an async fn yet, for that we also need to
modify the page cache. So this is a preparatory PR, albeit an important
one.

Part of #4743.
2023-08-25 12:28:01 +02:00
Felix Prasanna
18537be298 monitor: listen on correct port to accept agent connections (#5100)
## Problem
The previous arguments have the monitor listen on `localhost`, which the
informant can connect to since it's also in the VM, but which the agent
cannot. Also, the port is wrong.

## Summary of changes
Listen on `0.0.0.0:10301`
2023-08-24 17:32:46 -04:00
Felix Prasanna
3128eeff01 compute_ctl: add vm-monitor (#4946)
Co-authored-by: Em Sharnoff <sharnoff@neon.tech>
2023-08-24 15:54:37 -04:00
Arpad Müller
227c87e333 Make EphemeralFile::write_blob function async (#5056)
## Problem

The `EphemeralFile::write_blob` function accesses the page cache
internally. We want to require `async` for these accesses in #5023.

## Summary of changes

This removes the implementaiton of the `BlobWriter` trait for
`EphemeralFile` and turns the `write_blob` function into an inherent
function. We can then make it async as well as the `push_bytes`
function. We move the `SER_BUFFER` thread-local into the
`InMemoryLayerInner` so that the same buffer can be accessed by
different threads as the async is (potentially) moved between threads.

Part of #4743, preparation for #5023.
2023-08-24 19:18:30 +02:00
Alek Westover
e8f9aaf78c Don't use non-existent docker tags (#5096) 2023-08-24 19:45:23 +03:00
Chengpeng Yan
fa74d5649e rename EphmeralFile::size to EphemeralFile::len (#5076)
## Problem
close https://github.com/neondatabase/neon/issues/5034

## Summary of changes
Based on the
[comment](https://github.com/neondatabase/neon/pull/4994#discussion_r1297277922).
Just rename the `EphmeralFile::size` to `EphemeralFile::len`.
2023-08-24 16:41:57 +02:00
Joonas Koivunen
f70871dfd0 internal-devx: pageserver future layers (#5092)
I've personally forgotten why/how can we have future layers during
reconciliation. Adds `#[cfg(feature = "testing")]` logging when we
upload such index_part.json, with a cross reference to where the cleanup
happens.

Latest private slack thread:
https://neondb.slack.com/archives/C033RQ5SPDH/p1692879032573809?thread_ts=1692792276.173979&cid=C033RQ5SPDH

Builds upon #5074. Should had been considered on #4837.
2023-08-24 17:22:36 +03:00
Alek Westover
99a1be6c4e remove upload step from neon, it is in private repo now (#5085) 2023-08-24 17:14:40 +03:00
Joonas Koivunen
76aa01c90f refactor: single phase Timeline::load_layer_map (#5074)
Current implementation first calls `load_layer_map`, which loads all
local layers, cleans up files, leave cleaning up stuff to "second
function". Then the "second function" is finally called, it does not do
the cleanup and some of the first functions setup can torn down. "Second
function" is actually both `reconcile_with_remote` and
`create_remote_layers`.

This change makes it a bit more verbose but in one phase with the
following sub-steps:
1. scan the timeline directory
2. delete extra files
    - now including on-demand download files
    - fixes #3660
3. recoincile the two sources of layers (directory, index_part)
4. rename_to_backup future layers, short layers
5. create the remaining as layers

Needed by #4938.

It was also noticed that this is blocking code in an `async fn` so just
do it in a `spawn_blocking`, which should be healthy for our startup
times. Other effects includes hopefully halving of `stat` calls; extra
calls which were not done previously are now done for the future layers.

Co-authored-by: Christian Schwarz <christian@neon.tech>
Co-authored-by: John Spray <john@neon.tech>
2023-08-24 16:07:40 +03:00