hahait opened a new issue, #12834:
URL: https://github.com/apache/apisix/issues/12834

   ### Current Behavior
   
   When etcd is compacted, apisix will use load_full_data(). If there is a 
configuration error in an individual plugin(For example, proxy-cache) in the 
global plugin, it will cause all global plugins to become invalid
   
   It was found from etcd_config.lua that:
   `
   function sync_data(self)
       ……
       if self.need_reload then
           ……
           self.values = nil
           self.values_hash = nil
   
   `
   
   ### Expected Behavior
   
   1. Among the global plugins, the error reports of individual plugins should 
not affect the configuration and update of other plugins worldwide
   2. If the plugin is "disable": true, the incorrect configuration of this 
plugin should not affect the configuration and update of other plugins
   
   ### Error Logs
   
   1. The global plugin proxy-cache is configured incorrectly
   `2025/12/18 17:06:27 [error] 53#53: *142160819 [lua] config_etcd.lua:679: 
sync_data(): failed to check item data of [/apisix/global_rules] err:failed to 
check the configuration of plugin proxy-cache err: cache_zone disk_cache_one 
not found ,val: 
{"update_time":1766048710,"create_time":1756868235,"plugins":{"proxy-cache":{"hide_cache_headers":false,"cache_control":false,"cache_ttl":300,"cache_strategy":"disk","cache_method":["GET","HEAD"],"cache_http_status":[200,301,404],"cache_zone":"disk_cache_one","cache_key":["$host","$request_uri"],"_meta":{"disable":true}},……}`
   
   2. etcd is compacted,apisix watch canceled by etcd
   `2025/12/19 13:14:13 [warn] 57#57: *156949651 [lua] config_etcd.lua:227: 
watch canceled by etcd, res: {
     result = {
       canceled = true,
       compact_revision = "8023",
       header = {
         cluster_id = "10063310312338577470",
         member_id = "8355680492992881584",
         raft_term = "4"
       }
     }
   }, context: ngx.timer
   2025/12/19 13:14:13 [error] 57#57: *156949651 [lua] config_etcd.lua:230: 
etcd compacted, compact_revision=8023, context: ngx.timer`
   
   3. apisix load_full_data() ,Meanwhile reports a format error of the global 
plugin proxy-cache
   `2025/12/19 13:14:13 [error] 57#57: *156823782 [lua] config_etcd.lua:543: 
load_full_data(): failed to check item data of [/apisix/global_rules] 
err:failed to check the configuration of plugin proxy-cache err: cache_zone 
disk_cache_one not found ,val: 
{"id":"1","plugins":{"proxy-cache":{"_meta":{"disable":true},"cache_http_status":[200,301,404],"cache_method":["GET","HEAD"],"cache_key":["$host","$request_uri"],"cache_control":false,"hide_cache_headers":false,"cache_zone":"disk_cache_one","cache_strategy":"disk","cache_ttl":300},……}`
   
   4. All global plugins are invalid
   
   ### Steps to Reproduce
   
   1. The proxy-cache plugin was configured incorrectly. You can refer to the 
configuration in the error log
   2. Wait for etcd compact and apisix to handle the compact event, and execute 
load_full_data()
   
   ### Environment
   
   - APISIX version (run `apisix version`): 3.10
   - Operating system (run `uname -a`): debian 11.10, 4.19.0-10-amd64
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`): 
openresty/1.25.3.2
   - etcd version, if relevant (run `curl 
http://127.0.0.1:9090/v1/server_info`): 3.5.16
   - APISIX Dashboard version, if relevant: 3.0.1
   - Plugin runner version, for issues related to plugin runners: 
   - LuaRocks version, for installation issues (run `luarocks --version`):
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to