tiflow icon indicating copy to clipboard operation
tiflow copied to clipboard

Cli(ticdc): add safepoint command

Open wk989898 opened this issue 6 months ago • 6 comments

What problem does this PR solve?

Issue Number: close #11470

What is changed and how it works?

Add safepoint command which can query, set and delete servicesafepoint. It works by updating ttl with pd.client.UpdateServiceGCSafePoint and query pd's API to show all service gc safepoints.

The pdClient exposes the UpdateServiceGCSafePoint interface, which accepts three parameters: serviceID, ttl, and safePoint. The specific behavior of UpdateServiceGCSafePoint is as follows:

  • It updates the specified service safe point using the provided service_id, the value of the service safe point, and the TTL. It returns the minimum value among all current service safe points (including itself) after the update.
  • If the service safe point for the specified service_id does not exist, it will be created.
  • If the specified service safe point exists and its value is equal to the value passed in the current call (i.e., the service safe point value has not changed), the TTL can still be updated. Passing a TTL less than or equal to 0 will have the effect of deletion.
  • If the value of the specified service safe point is less than the current minimum value among all existing service safe points, no action will be taken, and the current minimum value will still be returned. It is necessary to confirm whether the operation was successful.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below) 截屏2024-08-06 17 30 52 截屏2024-08-06 17 31 12 截屏2024-08-06 17 31 57 截屏2024-08-06 17 34 36 截屏2024-08-06 17 37 06 截屏2024-08-06 17 37 57

Questions

Will it cause performance regression or break compatibility?
Do you need to update user documentation, design documentation or monitoring documentation?

need update user documentation

Release note

None.

wk989898 avatar Aug 06 '24 07:08 wk989898