From dd178cca54fbd258aab7539ee64622894c277f68 Mon Sep 17 00:00:00 2001 From: Amogh Bharadwaj Date: Thu, 5 Oct 2023 21:29:07 +0530 Subject: [PATCH] Write Mode Overwrite Check (#489) Fixes the check for write mode overwrite --- nexus/flow-rs/src/grpc.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/nexus/flow-rs/src/grpc.rs b/nexus/flow-rs/src/grpc.rs index 9c5d4a14e..95f3c206c 100644 --- a/nexus/flow-rs/src/grpc.rs +++ b/nexus/flow-rs/src/grpc.rs @@ -291,9 +291,17 @@ impl FlowGrpcClient { } } if !cfg.initial_copy_only { - return anyhow::Result::Err(anyhow::anyhow!( - "write mode overwrite can only be set with initial_copy_only = true" - )); + if let Some(QRepWriteMode { + write_type: wt, + upsert_key_columns: _, + }) = cfg.write_mode + { + if wt == QRepWriteType::QrepWriteModeOverwrite as i32 { + return anyhow::Result::Err(anyhow::anyhow!( + "write mode overwrite can only be set with initial_copy_only = true" + )); + } + } } self.start_query_replication_flow(&cfg).await }