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

fix(etcd): handle etcd compaction #2687

Merged
merged 2 commits into from
Nov 15, 2020

Conversation

spacewander
Copy link
Member

@spacewander spacewander commented Nov 10, 2020

Close #2680.

What this PR does / why we need it:

Pre-submission checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible?

@ShiningRush
Copy link
Contributor

We can make a test case for the situation.

@spacewander
Copy link
Member Author

@ShiningRush
It is too tough to provide a stable test case. I have to run several times manually to reproduce the issue.

@ShiningRush
Copy link
Contributor

ShiningRush commented Nov 10, 2020

it should reproduce by follow steps:

  • update the some key
  • manually compact etcd by etcdctl
  • restart etcd to cause apisix reconnect

I haven't actually tried it yet, but I guess it should be able to reproduce stably

@spacewander
Copy link
Member Author

@ShiningRush
Yes, it is how I reproduce it. But in the local machine, the sync is so fast that you don't have enough time to reconnect before sync the data. (This is why I need to try many times manually). It would be worse in the CI environment.

@membphis membphis added this to the 2.1 milestone Nov 11, 2020

local compact_revision = v3res.result.compact_revision
if compact_revision and tonumber(compact_revision) > 0 then
-- When the revisions are compacted, there might be compacted changes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a todo comment, missing test cases, will add later

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@membphis
Solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug:config_etcd did not handle the watcher be canceled
4 participants