Skip to content

shard not fail after corrupted in update_by_id #129994

Closed as not planned
Closed as not planned
@conicL

Description

@conicL

When using the update API,

POST  index_name/_update/3625054589

I encountered a persistent failure with the specific exception:

{
  "error" : {
    "root_cause" : [
      {
        "type" : "exception",
        "reason" : "Failed to get type [_doc] and id [3625054589]"
      }
    ],
    "type" : "exception",
    "reason" : "Failed to get type [_doc] and id [3625054589]",
    "caused_by" : {
      "type" : "corrupt_index_exception",
      "reason" : "Corrupted: docID=418443, docBase=4, chunkDocs=31, numDocs=6350815 (resource=NIOFSIndexInput(path=\"es/data/nodes/0/indices/wxIwA-bDSouiwKS-4y1eiA/16/index/_p7lp9.fdt\"))"
    }
  },
  "status" : 500
}

I found that when retrieving the document in ShardGetService, the CorruptIndexException is not handled, so the shard fail is not triggered. My ES version is 7142, and the related code is

https://github.com/elastic/elasticsearch/blob/7.14/server/src/main/java/org/elasticsearch/index/get/ShardGetService.java#L222

If failShard is not executed, the exception will continue to occur, even if the current replica data might be correct. Therefore, should CorruptedIndexException be handled separately at this point?

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs:triageRequires assignment of a team area label

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions