pageserver: update upload queue TODOs (#11377)

Update some upload queue TODOs, particularly to track
https://github.com/neondatabase/neon/issues/10283, which I won't get
around to.
This commit is contained in:
Erik Grinaker
2025-04-01 13:38:12 +02:00
committed by GitHub
parent 557127550c
commit 225cabd84d

View File

@@ -1968,9 +1968,7 @@ impl RemoteTimelineClient {
/// Pick next tasks from the queue, and start as many of them as possible without violating
/// the ordering constraints.
///
/// TODO: consider limiting the number of in-progress tasks, beyond what remote_storage does.
/// This can launch an unbounded number of queued tasks. `UploadQueue::next_ready()` also has
/// worst-case quadratic cost in the number of tasks, and may struggle beyond 10,000 tasks.
/// The number of inprogress tasks is limited by `Self::inprogress_tasks`, see `next_ready`.
fn launch_queued_tasks(self: &Arc<Self>, upload_queue: &mut UploadQueueInitialized) {
while let Some((mut next_op, coalesced_ops)) = upload_queue.next_ready() {
debug!("starting op: {next_op}");
@@ -2218,6 +2216,11 @@ impl RemoteTimelineClient {
}
res
}
// TODO: this should wait for the deletion to be executed by the deletion queue.
// Otherwise, the deletion may race with an upload and wrongfully delete a newer
// file. Some of the above logic attempts to work around this, it should be replaced
// by the upload queue ordering guarantees (see `can_bypass`). See:
// <https://github.com/neondatabase/neon/issues/10283>.
UploadOp::Delete(delete) => {
if self.config.read().unwrap().block_deletions {
let mut queue_locked = self.upload_queue.lock().unwrap();