@@ -91,15 +91,15 @@ func (w *worker) updateSnapID(ctx context.Context, oid, nid uint64) error {
9191 strconv .FormatUint (nid , 10 ))
9292}
9393
94- func ( w * worker ) upsertHistSnapshot (ctx context.Context , sctx sessionctx.Context , snapID uint64 ) error {
94+ func upsertHistSnapshot (ctx context.Context , sctx sessionctx.Context , snapID uint64 ) error {
9595 // TODO: fill DB_VER, WR_VER
9696 snapshotsInsert := sqlescape .MustEscapeSQL ("INSERT INTO %n.%n (`BEGIN_TIME`, `SNAP_ID`) VALUES (now(), %%?) ON DUPLICATE KEY UPDATE `BEGIN_TIME` = now()" ,
9797 WorkloadSchema , histSnapshotsTable )
9898 _ , err := runQuery (ctx , sctx , snapshotsInsert , snapID )
9999 return err
100100}
101101
102- func ( w * worker ) updateHistSnapshot (ctx context.Context , sctx sessionctx.Context , snapID uint64 , errs []error ) error {
102+ func updateHistSnapshot (ctx context.Context , sctx sessionctx.Context , snapID uint64 , errs []error ) error {
103103 var nerr any
104104 if err := stderrors .Join (errs ... ); err != nil {
105105 nerr = err .Error ()
@@ -167,7 +167,7 @@ func (w *worker) startSnapshot(_ctx context.Context) func() {
167167 // another owner won the etcd CAS loop.
168168 // it is unwanted but acceptable. because two owners should share
169169 // similar datetime, same cluster versions.
170- if err := w . upsertHistSnapshot (ctx , sess , snapID + 1 ); err != nil {
170+ if err := upsertHistSnapshot (ctx , sess , snapID + 1 ); err != nil {
171171 logutil .BgLogger ().Info ("repository could not insert into hist_snapshots" , zap .NamedError ("err" , err ))
172172 continue
173173 }
@@ -215,7 +215,7 @@ func (w *worker) startSnapshot(_ctx context.Context) func() {
215215 }
216216 wg .Wait ()
217217
218- if err := w . updateHistSnapshot (ctx , sess , snapID , errs ); err != nil {
218+ if err := updateHistSnapshot (ctx , sess , snapID , errs ); err != nil {
219219 logutil .BgLogger ().Info ("repository snapshot failed: could not update hist_snapshots" , zap .NamedError ("err" , err ))
220220 }
221221 }
0 commit comments