From 355f3e87f49a80441b9067a85bd605b51181855c Mon Sep 17 00:00:00 2001 From: The Magician Date: Fri, 20 Dec 2024 14:00:35 -0800 Subject: [PATCH] Add post update 5s sleep to Topic update (#12570) (#20772) [upstream:1a28a91cf77e481d012718eec9bdf7524c663e4f] Signed-off-by: Modular Magician --- .changelog/12570.txt | 3 +++ google/services/managedkafka/resource_managed_kafka_topic.go | 4 ++++ 2 files changed, 7 insertions(+) create mode 100644 .changelog/12570.txt diff --git a/.changelog/12570.txt b/.changelog/12570.txt new file mode 100644 index 00000000000..d528eb8ffd9 --- /dev/null +++ b/.changelog/12570.txt @@ -0,0 +1,3 @@ +```release-note:none +managedkafka: added 5 second wait post `google_managed_kafka_topic` update to fix eventual consistency errors +``` \ No newline at end of file diff --git a/google/services/managedkafka/resource_managed_kafka_topic.go b/google/services/managedkafka/resource_managed_kafka_topic.go index 5d88f831381..5735bc4a163 100644 --- a/google/services/managedkafka/resource_managed_kafka_topic.go +++ b/google/services/managedkafka/resource_managed_kafka_topic.go @@ -322,6 +322,10 @@ func resourceManagedKafkaTopicUpdate(d *schema.ResourceData, meta interface{}) e } + // This is useful if the resource in question doesn't have a perfectly consistent API + // That is, the Operation for Create might return before the Get operation shows the + // completed state of the resource. + time.Sleep(5 * time.Second) return resourceManagedKafkaTopicRead(d, meta) }