Commit 440c439 1 parent 3deccca commit 440c439 Copy full SHA for 440c439
File tree 1 file changed +7
-4
lines changed
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -137,6 +137,13 @@ func (s *schemaStore) Close(ctx context.Context) error {
137
137
func (s * schemaStore ) updateResolvedTsPeriodically (ctx context.Context ) error {
138
138
tryUpdateResolvedTs := func () {
139
139
pendingTs := s .pendingResolvedTs .Load ()
140
+ defer func () {
141
+ currentPhyTs := oracle .GetPhysical (s .pdClock .CurrentTime ())
142
+ resolvedPhyTs := oracle .ExtractPhysical (pendingTs )
143
+ resolvedLag := float64 (currentPhyTs - resolvedPhyTs ) / 1e3
144
+ metrics .SchemaStoreResolvedTsLagGauge .Set (float64 (resolvedLag ))
145
+ }()
146
+
140
147
if pendingTs <= s .resolvedTs .Load () {
141
148
return
142
149
}
@@ -180,10 +187,6 @@ func (s *schemaStore) updateResolvedTsPeriodically(ctx context.Context) error {
180
187
// so we can only update resolved ts after all ddl jobs are written to disk
181
188
// Can we optimize it to update resolved ts more eagerly?
182
189
s .resolvedTs .Store (pendingTs )
183
- currentPhyTs := oracle .GetPhysical (s .pdClock .CurrentTime ())
184
- resolvedPhyTs := oracle .ExtractPhysical (pendingTs )
185
- resolvedLag := float64 (currentPhyTs - resolvedPhyTs ) / 1e3
186
- metrics .SchemaStoreResolvedTsLagGauge .Set (float64 (resolvedLag ))
187
190
s .dataStorage .updateUpperBound (UpperBoundMeta {
188
191
FinishedDDLTs : s .finishedDDLTs ,
189
192
SchemaVersion : s .schemaVersion ,
You can’t perform that action at this time.
0 commit comments