Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/storage-controller/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1587,6 +1587,15 @@ where
};
*cur_export = new_export;

// For `ALTER SINK`, the snapshot should only occur if the sink has not made any progress.
// This prevents unnecessary decoding in the sink.
// If the write frontier of the sink is strictly larger than its read hold, it must have at
// least written out its snapshot, and we can skip reading it; otherwise assume we may have
// to replay from the beginning.
// TODO(database-issues#10002): unify this with run_export, if possible
let with_snapshot = new_description.sink.with_snapshot
&& !PartialOrder::less_than(&new_description.sink.as_of, &cur_export.write_frontier);

let cmd = RunSinkCommand {
id,
description: StorageSinkDesc {
Expand All @@ -1597,7 +1606,7 @@ where
as_of: new_description.sink.as_of,
version: new_description.sink.version,
from_storage_metadata,
with_snapshot: new_description.sink.with_snapshot,
with_snapshot,
to_storage_metadata,
commit_interval: new_description.sink.commit_interval,
},
Expand Down