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 compact err【do not merge me! only for discussion】 #11149

Closed

Conversation

Revolyssup
Copy link
Contributor

Description

Fixes # (issue)

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)

@Revolyssup Revolyssup requested a review from nic-chen April 12, 2024 04:26
@Revolyssup Revolyssup changed the title feat: etcd compact err fix fix: etcd compact err Apr 12, 2024
if not dir_res then
if err == "compacted" then
Copy link
Member

Choose a reason for hiding this comment

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

please don't remove these codes, we should keep them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

okay

@Revolyssup
Copy link
Contributor Author

@nic-chen Readded the error handling for compact err

@membphis membphis changed the title fix: etcd compact err fix: etcd compact err【do not merge me! only for discussion】 Apr 12, 2024
Comment on lines 348 to 355
log.info("updating prev_index from "..self.prev_index.." to "..rev )
if rev then
if rev == self.prev_index then
goto fail
end
self.prev_index = rev
end
goto waitdir
Copy link
Member

Choose a reason for hiding this comment

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

how about the change?

Suggested change
log.info("updating prev_index from "..self.prev_index.." to "..rev )
if rev then
if rev == self.prev_index then
goto fail
end
self.prev_index = rev
end
goto waitdir
log.info("updating prev_index from "..self.prev_index.." to "..rev )
self:upgrade_version(rev)

if err == "compacted" then
self.need_reload = true
log.warn("waitdir [", self.key, "] err: ", err,
", will read the configuration again via readdir")
return false
goto fail
Copy link
Member

Choose a reason for hiding this comment

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

we don't need to change the workflow

@moonming moonming closed this Apr 25, 2024
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.

3 participants