From d49f984e9f0c61d9289f6b76bba081e44d860d03 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Mon, 6 May 2024 09:16:50 -0400 Subject: [PATCH] Use node ModRevision consistently in etcd2topo implementation Signed-off-by: Matt Lord --- go/vt/topo/etcd2topo/watch.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/go/vt/topo/etcd2topo/watch.go b/go/vt/topo/etcd2topo/watch.go index 2fc58d437ff..a3edf727b55 100644 --- a/go/vt/topo/etcd2topo/watch.go +++ b/go/vt/topo/etcd2topo/watch.go @@ -51,7 +51,10 @@ func (s *Server) Watch(ctx context.Context, filePath string) (*topo.WatchData, < } wd := &topo.WatchData{ Contents: initial.Kvs[0].Value, - Version: EtcdVersion(initial.Kvs[0].Version), + // ModRevision is used for the topo.Version value as we get the new Revision value back + // when updating the file/key within a transaction in file.go and so this is the opaque + // version that we can use to enforce serializabile writes for the file/key. + Version: EtcdVersion(initial.Kvs[0].ModRevision), } // Create an outer context that will be canceled on return and will cancel all inner watches.