Skip to content

Commit

Permalink
ensure consistent table copy order
Browse files Browse the repository at this point in the history
  • Loading branch information
imor committed Nov 29, 2024
1 parent 549e919 commit 662de0e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pg_replicate/src/pipeline/data_pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ impl<Src: Source, Snk: Sink> DataPipeline<Src, Snk> {
async fn copy_tables(&mut self, copied_tables: &HashSet<TableId>) -> Result<(), PipelineError> {
let table_schemas = self.source.get_table_schemas();

for table_schema in table_schemas.values() {
let mut keys: Vec<u32> = table_schemas.keys().copied().collect();
keys.sort();

for key in keys {
let table_schema = table_schemas.get(&key).expect("failed to get table key");
if copied_tables.contains(&table_schema.table_id) {
continue;
}
Expand Down

0 comments on commit 662de0e

Please sign in to comment.