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: update watch_ctx.revision to avoid multiple resyncs #12021

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

Revolyssup
Copy link
Contributor

@Revolyssup Revolyssup commented Mar 5, 2025

Description

Fixes # (issue)
Recently this PR was merged #12015

Although it fixed the original issue, it didn't update revision on the watch context which caused resync to happen again and again. This resync will keep happening until the revision will catch up to the watch_ctx.rev.

2025/03/05 22:52:58 [error] 269#269: *7393 [lua] config_etcd.lua:267: received smaller revision, rev=19, watch_ctx.rev=41. etcd may be restarted. resyncing...., context: ngx.timer
2025/03/05 22:52:58 [error] 269#269: *113 [lua] config_etcd.lua:647: sync_data(): waitdir [/apisix/upstreams] err: restarted, will read the configuration again via readdir, context: ngx.timer
2025/03/05 22:53:42 [error] 267#267: *8621 [lua] config_etcd.lua:267: received smaller revision, rev=20, watch_ctx.rev=41. etcd may be restarted. resyncing...., context: ngx.timer
2025/03/05 22:53:42 [error] 272#272: *36 [lua] config_etcd.lua:647: sync_data(): waitdir [/apisix/protos] err: restarted, will read the configuration again via readdir, context: ngx.timer

This change updates watch_ctx.revision to the last observed revision so that once resync takes place it doesn't happen again and again.

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Mar 5, 2025
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant