Skip to content

fix(etcd): handle etcd compaction#2687

Merged
membphis merged 2 commits into
apache:masterfrom
spacewander:etcd_compact_2680
Nov 15, 2020
Merged

fix(etcd): handle etcd compaction#2687
membphis merged 2 commits into
apache:masterfrom
spacewander:etcd_compact_2680

Conversation

@spacewander

@spacewander spacewander commented Nov 10, 2020

Copy link
Copy Markdown
Member

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
Copy Markdown
Contributor

We can make a test case for the situation.

@spacewander

Copy link
Copy Markdown
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

ShiningRush commented Nov 10, 2020

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Comment thread apisix/core/etcd.lua

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
Copy Markdown
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
Copy Markdown
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