@@ -143,7 +143,7 @@ func (m *manager) register(db *v1alpha1.TiDB) {
143143 }
144144 m .standby .add (hash , key )
145145
146- m .logger .Info ("register standby instance" , "instance" , key , "hash" , hash )
146+ m .logger .Info ("register standby instance" , "instance" , key , "hash" , hash , "rv" , db . GetResourceVersion () )
147147
148148 return
149149 }
@@ -161,6 +161,8 @@ func (m *manager) register(db *v1alpha1.TiDB) {
161161
162162 item .hash = nHash
163163 item .instance = db .DeepCopy ()
164+
165+ m .logger .Info ("update standby instance" , "instance" , key , "hash" , nHash , "rv" , db .GetResourceVersion ())
164166 // - applied and uid is not changed
165167 // - instance has been adopted and mode is changed to normal.
166168 // - just wait until the instance is synced.
@@ -199,10 +201,16 @@ func (m *manager) Adopt(dbg *v1alpha1.TiDBGroup, index int) (*v1alpha1.TiDB, Unl
199201 adopting := m .adopting .list (key )
200202 if index < len (adopting ) {
201203 inKey := adopting [index ]
204+ // should always exist
205+ item := m .keyToInstance [inKey ]
202206
203- m .logger .Info ("return adopting standby instance" , "group" , key , "instance" , inKey , "index" , index )
207+ m .logger .Info ("return adopting standby instance" ,
208+ "group" , key ,
209+ "instance" , inKey ,
210+ "index" , index ,
211+ "rv" , item .instance .GetResourceVersion ())
204212
205- return m . keyToInstance [ inKey ] .instance .DeepCopy (), DoNothing
213+ return item .instance .DeepCopy (), DoNothing
206214 }
207215
208216 hash := hashTiDBGroup (dbg )
@@ -217,7 +225,13 @@ func (m *manager) Adopt(dbg *v1alpha1.TiDBGroup, index int) (*v1alpha1.TiDB, Unl
217225 }
218226 m .lock (dbg , item )
219227
220- m .logger .Info ("adopting standby instance" , "group" , key , "instance" , k , "hash" , item .hash , "index" , index )
228+ m .logger .Info ("adopting standby instance" ,
229+ "group" , key ,
230+ "instance" , k ,
231+ "hash" , item .hash ,
232+ "index" , index ,
233+ "rv" , item .instance .GetResourceVersion (),
234+ )
221235
222236 return item .instance .DeepCopy (), m .unlockFunc (item )
223237 }
0 commit comments