Skip to content

DELETE index/_doc/id async_bulk failed. #106

@Daemonyuetao

Description

@Daemonyuetao

Description

当网关代理的 backup ES 版本为 6.x 时,DELETE index/_doc/id 会失败

Steps to reproduce

  1. 极限网关后端分别代理两台 6.8.2 的 ES 集群
  2. 启动极限网关
  3. 对网关 api 端口发送一条写入:
PUT test/_doc/1
{
  "a": 1
}
  1. 对网关 api 端口发送一条删除:
DELETE test/_doc/1

Expected behavior

对目标ES集群查询应该返回:

# request:
GET test/_doc/1

# response:
{
  "_index": "test",
  "_type": "_doc",
  "_id": "3",
  "found": false
}

Actual behavior

实际返回是:

# request:
GET test/_doc/1

# response:
{
  "_index": "test",
  "_type": "_doc",
  "_id": "3",
  "_version": 1,
  "_seq_no": 0,
  "_primary_term": 1,
  "found": true,
  "_source": {
    "a": 1
  }
}

然后查看async日志:

GET .infini_async_bulk_results/_search
{
  "_source": [
    "request.body",
    "bulk_results.error_msgs",
    "timestamp",
    "request.uri",
    "bulk_results.codes"
  ],
  "query": {
    "bool": {
      "must_not": [
        {
          "terms": {
            "bulk_results.codes": [
              201,
              200
            ]
          }
        }
      ]
    }
  },
  "sort": [
    {
      "timestamp": {
        "order": "desc"
      }
    }
  ]
}

可以看到报错:

          "bulk_results" : {
            "error_msgs" : [
              """{"root_cause":[{"type":"action_request_validation_exception","reason":"Validation Failed: 1: type is missing;"}],"type":"action_request_validation_exception","reason":"Validation Failed: 1: type is missing;"}"""
            ]
          },
          "request" : {
            "body" : """{ "delete" : { "_index" : "test1721" , "_id" : "3" } }
""",
            "uri" : "http://10.0.2.186:9200/_bulk"
          }

Environment

* Build: [gateway 1.29.8 2197 2025-07-24 02:38:05 +0000 UTC 2026-12-31 10:10:10 +0000 UTC c4f2aa8ae6f9 9a7a03fc6096 5550ee545c04]
* [Linux] CentOS Linux release 7.9.2009 (Core)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions