Skip to content

Inconsistent docvalues type in keyword fields with ignore_above #138857

@jordan-powers

Description

@jordan-powers

Elasticsearch Version

9.3.0-SNAPSHOT

Installed Plugins

No response

Java Version

bundled

OS Version

n/a

Problem Description

IllegalArgumentException when indexing documents with ignore_above into upgraded nodes.

Steps to Reproduce

  1. Start a node with elasticsearch built at 0aa383b (the current serverless build).
git checkout patch/serverless-fix
./gradlew run -Dtests.es.xpack.security.enabled=false -Dtests.es.cluster.logsdb.enabled=true -Drun.license_type=trial -Dtests.heap.size=4G -Dtests.jvm.argline="-da -dsa" --info 
  1. Create an index with synthetic source and a keyword field with ignore_above specified.
curl -X PUT -H "Content-Type: application/json" localhost:9200/test -d '{"settings": { "index.mapping.source.mode": "synthetic" }, "mappings": { "properties": { "foo": { "type": "keyword", "ignore_above": 10 } } } }'
  1. Index a document with a value that trips the ignore_above.
curl -X POST -H "Content-Type: application/json" localhost:9200/test/_create/1 -d '{"foo": "Apache lucene powers elasticsearch"}'
  1. Stop the node, checkout main, rebuild and start the new node with the same data directory.
git checkout main
./gradlew run --preserve-data -Dtests.es.xpack.security.enabled=false -Dtests.es.cluster.logsdb.enabled=true -Drun.license_type=trial -Dtests.heap.size=4G -Dtests.jvm.argline="-da -dsa" --info
  1. Index another document that trips the ignore_above.
curl -X POST -H "Content-Type: application/json" localhost:9200/test/_create/2 -d '{"foo": "Apache lucene powers elasticsearch"}'

Logs (if relevant)

{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "cannot change field \"foo._original\" from doc values type=NONE to inconsistent doc values type=BINARY"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "cannot change field \"foo._original\" from doc values type=NONE to inconsistent doc values type=BINARY"
  },
  "status": 400
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions