Skip to content

Conversation

LiteSun
Copy link
Member

@LiteSun LiteSun commented May 21, 2025

Description

When APISIX is running as a data plane, if any ETCD write operations are performed through core.etcd related functions or CLI, warning logs will be printed without blocking the write operations. This functionality will be deprecated in future versions, after which write operations will no longer be allowed.

Mailing list: https://lists.apache.org/thread/gfsooqm4cz6cx2sh7htmqgwlml5kggm2

Scope of Impact

ETCD Write Operations Using core.etcd Related Functions

Example usage:

local core = require("apisix.core")

core.etcd.set("key", "value")

Based on the analysis of the apisix/core/etcd.lua file, the following functions can perform ETCD write operations:

  • _M.set
  • _M.atomic_set
  • _M.push
  • _M.delete
  • _M.rmdir
  • _M.keepalive

For these functions, warning logs will be printed to inform users that this functionality will be deprecated in future versions, after which write operations will no longer be allowed.

ETCD Write Operations Using CLI Created by core.etcd.new()

Example usage:

local core = require("apisix.core")

local etcd_cli = core.etcd.new()
etcd_cli:set("key", "value")

After exporting the CLI, referring to the https://github.com/api7/lua-resty-etcd/blob/master/lib/resty/etcd/v3.lua file, the following operations perform ETCD write operations:

  • setnx
  • setx
  • delete
  • rmdir
  • grant
  • revoke
  • keepalive
  • set

For these functions, warning logs will be printed to inform users that this functionality will be deprecated in future versions, after which write operations will no longer be allowed.

Timeline

If there are no strong objections on the mailing list, the plan is as follows:

  1. Add warning messages in version 3.13.0 without blocking ETCD write operations
  2. Provide an adjustment period for users during versions 3.14.0 and 3.15.0, and officially deprecate this functionality in version 3.16.0. Considering the uncertainty in APISIX's release cycle, this functionality will be officially deprecated no later than 6 months after the release of version 3.13.0.

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. enhancement New feature or request labels May 21, 2025
@LiteSun LiteSun marked this pull request as draft May 23, 2025 04:50
@LiteSun LiteSun marked this pull request as ready for review May 25, 2025 23:05
@LiteSun LiteSun marked this pull request as draft May 29, 2025 03:59
@LiteSun LiteSun marked this pull request as ready for review June 3, 2025 07:32
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Jun 3, 2025
@LiteSun LiteSun requested a review from moonming June 3, 2025 07:33
moonming
moonming previously approved these changes Jun 9, 2025



local function block_write_if_data_plane()
Copy link
Member

Choose a reason for hiding this comment

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

block is not a good name in here. block is often used to indicate IO blocking, such as: blocking io and non-blocking io. block_write has a significant ambiguity with the actual function of this function. It is recommended to change it to disable, etc.

Copy link
Member Author

Choose a reason for hiding this comment

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

updated

Copy link
Contributor

@ronething ronething left a comment

Choose a reason for hiding this comment

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

lgtm

@LiteSun LiteSun merged commit 9c3f5ad into apache:master Jun 10, 2025
30 of 31 checks passed
@LiteSun LiteSun deleted the sy/add-etcd-warning branch June 10, 2025 08:45
Crazy-xyr pushed a commit to Crazy-xyr/apisix that referenced this pull request Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants