From 43efa97d605a61b127274cc62e9fecef185af85f Mon Sep 17 00:00:00 2001 From: Bin Shi Date: Tue, 20 Jun 2023 21:59:30 -0700 Subject: [PATCH] Add more log Signed-off-by: Bin Shi --- client/tso_dispatcher.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/tso_dispatcher.go b/client/tso_dispatcher.go index 022be1b93b1..c1e94f0f230 100644 --- a/client/tso_dispatcher.go +++ b/client/tso_dispatcher.go @@ -741,6 +741,14 @@ func (c *tsoClient) compareAndSwapTS( lastKeyspaceGroupID := lastTSOPointer.keyspaceGroupID lastPhysical := lastTSOPointer.physical lastLogical := lastTSOPointer.logical + + if lastKeyspaceGroupID != respKeyspaceGroupID { + log.Info("[tso] keyspace group changed", + zap.String("dc-location", dcLocation), + zap.Uint32("old-group-id", lastKeyspaceGroupID), + zap.Uint32("new-group-id", respKeyspaceGroupID)) + } + // The TSO we get is a range like [largestLogical-count+1, largestLogical], so we save the last TSO's largest logical // to compare with the new TSO's first logical. For example, if we have a TSO resp with logical 10, count 5, then // all TSOs we get will be [6, 7, 8, 9, 10].