From 5cf33b4fd425210fb194e3a9884342866fc61f3c Mon Sep 17 00:00:00 2001 From: Tim Vaillancourt Date: Sun, 23 Feb 2025 21:18:56 +0100 Subject: [PATCH] `vtorc`: use `REPLACE INTO` in `node_health` table update Signed-off-by: Tim Vaillancourt --- go/vt/vtorc/process/health.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/go/vt/vtorc/process/health.go b/go/vt/vtorc/process/health.go index d448f03bb83..9a37b1c120d 100644 --- a/go/vt/vtorc/process/health.go +++ b/go/vt/vtorc/process/health.go @@ -35,12 +35,7 @@ var ThisNodeHealth = &NodeHealth{} // writeHealthToDatabase writes to the database and returns if it was successful. func writeHealthToDatabase() bool { - _, err := db.ExecVTOrc("DELETE FROM node_health") - if err != nil { - log.Error(err) - return false - } - sqlResult, err := db.ExecVTOrc(`INSERT + sqlResult, err := db.ExecVTOrc(`REPLACE INTO node_health ( last_seen_active ) VALUES (