Repository: tikv/tikv (language: rust)

Issue:
Logs and metrics pertaining resolved_ts gap can be wrong if TSO fetch fails
## Bug Report

<!-- Thanks for your bug report! Don't worry if you can't fill out all the sections. -->

https://github.com/tikv/tikv/blob/261458672ab66e6acef5017535783628e62bb76c/components/resolved_ts/src/advance.rs#L109-L113

`last_pd_tso` may be updated to 0.

The field is only used for diagnosis.
The consequence can be misleading gaps in logs and metrics, but not correctness risks.

### What version of TiKV are you using?
<!-- You can run `tikv-server --version` -->

master and versions in [v7.3, v8.5]

### What operating system and CPU are you using?
<!-- If you're using Linux, you can run `cat /proc/cpuinfo` -->

### Steps to reproduce
<!-- If possible, provide a recipe for reproducing the error. A complete runnable program is good. -->

### What did you expect?

### What did happened?



Discussion / hints:

Fix patch:
diff --git a/components/resolved_ts/src/advance.rs b/components/resolved_ts/src/advance.rs
index 9b7def6d8d8..a20e5c6b80d 100644
--- a/components/resolved_ts/src/advance.rs
+++ b/components/resolved_ts/src/advance.rs
@@ -106,10 +106,12 @@ impl AdvanceTsWorker {
 
         let last_pd_tso = self.last_pd_tso.clone();
         let fut = async move {
-            // Ignore get tso errors since we will retry every `advdance_ts_interval`.
+            // Ignore get tso errors since we will retry every `advance_ts_interval`.
             let mut min_ts = pd_client.get_tso().await.unwrap_or_default();
             if let Ok(mut last_pd_tso) = last_pd_tso.try_lock() {
-                *last_pd_tso = Some((min_ts, Instant::now()));
+                if !min_ts.is_zero() {
+                    *last_pd_tso = Some((min_ts, Instant::now()));
+                }
             }
             let mut ts_source = TsSource::PdTso;
 


Test patch: