Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not create changefeed when start ts is less than current ts - gcttl #1839

Closed
overvenus opened this issue May 26, 2021 · 0 comments
Closed
Assignees
Labels
area/ticdc Issues or PRs related to TiCDC. difficulty/medium Medium task. severity/major type/bug The issue is confirmed as a bug.

Comments

@overvenus
Copy link
Member

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do? If possible, provide a recipe for reproducing the error.

Create a changefeed with a start ts that is close to gc safepoint.

# Change gc lift time to 2400h
mysql -h 172.16.5.33 -P 47904 -u root -E -e 'update mysql.tidb set VARIABLE_VALUE="2400h" where VARIABLE_NAME="tikv_gc_life_time";'

# Wait 24 hours (the default gc-ttl)

tiup cdc:nightly cli --pd="http://172.16.5.33:47902" changefeed create --sink-uri="blackhole://" -c "bl2" \
  --start-ts=$(( $(pd-ctl -u http://0.0.0.0:47902 service-gc-safepoint | jq '.service_gc_safe_points[] | select(.service_id == "gc_worker") | .safe_point') + 1000 )) --no-confirm --sort-engine=unified

tiup cdc:v5.0.0-nightly cli --pd="http://172.16.5.33:47902" changefeed list
The component `cdc` version v5.0.0-nightly is not installed; downloading from repository.
component cdc version v5.0.0-nightly is already installed
Starting component `cdc`: /home/stn/.tiup/components/cdc/v5.0.0-nightly/cdc cli --pd=http://172.16.5.33:47902 changefeed list
[
  {
    "id": "bl1",
    "summary": {
      "state": "normal",
      "tso": 425199630964752529,
      "checkpoint": "2021-05-26 13:44:29.586",
      "error": null
    }
  },
  {
    "id": "bl2",
    "summary": {
      "state": "stopped",
      "tso": 425043878316868600,
      "checkpoint": "2021-05-19 16:42:00.386",
      "error": {
        "addr": "172.16.5.33:47913",
        "code": "CDC:ErrSnapshotLostByGC",
        "message": "[CDC:ErrSnapshotLostByGC]fail to create or maintain changefeed due to snapshot loss caused by GC. checkpoint-ts 425043878316868600 is earlier than GC safepoint at 425177025946845484"
      }
    }
  }
]

pd-ctl tso 425043878316868600
system:  2021-05-19 16:42:00.386 +0800 CST
logic:  1016

pd-ctl tso 425177025946845484
system:  2021-05-25 13:47:18.286 +0800 CST
logic:  300
  1. What did you expect to see?

Create a changefeed successfully.

  1. What did you see instead?

Failed.

  1. Versions of the cluster

Latest release-4.0.

@overvenus overvenus added the type/bug The issue is confirmed as a bug. label May 26, 2021
@asddongmen asddongmen self-assigned this May 26, 2021
@amyangfei amyangfei added the difficulty/medium Medium task. label Jul 12, 2021
@AkiraXie AkiraXie added the area/ticdc Issues or PRs related to TiCDC. label Mar 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ticdc Issues or PRs related to TiCDC. difficulty/medium Medium task. severity/major type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

5 participants