Skip to content

Commit 5d7e4ce

Browse files
committed
store: Sort unfinished tables in CopyState
That makes the order in which tables are copied predictable
1 parent 3369381 commit 5d7e4ce

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

store/postgres/src/copy.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,9 @@ impl CopyState {
195195
target_block: BlockPtr,
196196
) -> Result<CopyState, StoreError> {
197197
let tables = TableState::load(conn, src.as_ref(), dst.as_ref())?;
198-
let (finished, unfinished) = tables.into_iter().partition(|table| table.finished());
198+
let (finished, mut unfinished): (Vec<_>, Vec<_>) =
199+
tables.into_iter().partition(|table| table.finished());
200+
unfinished.sort_by_key(|table| table.dst.object.to_string());
199201
Ok(CopyState {
200202
src,
201203
dst,

0 commit comments

Comments
 (0)