From 9e8a9d89c75775b3f92a07d665cc213d4723f4fc Mon Sep 17 00:00:00 2001 From: Manan Gupta Date: Thu, 28 Mar 2024 21:40:43 +0530 Subject: [PATCH] refactor: rename detection id Signed-off-by: Manan Gupta --- go/vt/vtorc/db/generate_base.go | 4 ++-- go/vt/vtorc/logic/topology_recovery.go | 2 +- go/vt/vtorc/logic/topology_recovery_dao.go | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go/vt/vtorc/db/generate_base.go b/go/vt/vtorc/db/generate_base.go index e063634a6c2..fbb96ef75c0 100644 --- a/go/vt/vtorc/db/generate_base.go +++ b/go/vt/vtorc/db/generate_base.go @@ -179,7 +179,7 @@ CREATE TABLE topology_recovery ( shard varchar(128) NOT NULL, is_successful TINYint NOT NULL DEFAULT 0, all_errors text not null default '', - last_detection_id bigint not null default 0, + detection_id bigint not null default 0, PRIMARY KEY (recovery_id) )`, ` @@ -376,7 +376,7 @@ CREATE INDEX end_recovery_idx_topology_recovery on topology_recovery (end_recove CREATE INDEX instance_timestamp_idx_database_instance_analysis_changelog on database_instance_analysis_changelog (alias, analysis_timestamp) `, ` -CREATE INDEX last_detection_idx_topology_recovery on topology_recovery (last_detection_id) +CREATE INDEX detection_idx_topology_recovery on topology_recovery (detection_id) `, ` CREATE INDEX last_seen_active_idx_node_health on node_health (last_seen_active) diff --git a/go/vt/vtorc/logic/topology_recovery.go b/go/vt/vtorc/logic/topology_recovery.go index 8322e0c7db0..13113453c6e 100644 --- a/go/vt/vtorc/logic/topology_recovery.go +++ b/go/vt/vtorc/logic/topology_recovery.go @@ -110,7 +110,7 @@ type TopologyRecovery struct { AllErrors []string RecoveryStartTimestamp string RecoveryEndTimestamp string - LastDetectionID int64 + DetectionID int64 RelatedRecoveryID int64 Type RecoveryType } diff --git a/go/vt/vtorc/logic/topology_recovery_dao.go b/go/vt/vtorc/logic/topology_recovery_dao.go index 8ca4e8f3ccc..dd5f8a96430 100644 --- a/go/vt/vtorc/logic/topology_recovery_dao.go +++ b/go/vt/vtorc/logic/topology_recovery_dao.go @@ -73,7 +73,7 @@ func writeTopologyRecovery(topologyRecovery *TopologyRecovery) (*TopologyRecover analysis, keyspace, shard, - last_detection_id + detection_id ) values ( ?, ?, @@ -171,7 +171,7 @@ func readRecoveries(whereCondition string, limit string, args []any) ([]*Topolog keyspace, shard, all_errors, - last_detection_id + detection_id from topology_recovery %s @@ -198,7 +198,7 @@ func readRecoveries(whereCondition string, limit string, args []any) ([]*Topolog topologyRecovery.AllErrors = strings.Split(m.GetString("all_errors"), "\n") - topologyRecovery.LastDetectionID = m.GetInt64("last_detection_id") + topologyRecovery.DetectionID = m.GetInt64("detection_id") res = append(res, &topologyRecovery) return nil