From 4c13df40195ab91dde537f0a74c78a3e06ef1859 Mon Sep 17 00:00:00 2001 From: Amogh-Bharadwaj Date: Thu, 5 Oct 2023 20:27:53 +0530 Subject: [PATCH] writemode check fix --- 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 9c5d4a14e7..95f3c206cb 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 }