{"record":{"id":"3002c955af00c105","repo":"quickwit-oss/quickwit","slug":"new-doc-mapping-uid-should-differ-from-the-current","errorCode":null,"errorMessage":"new doc mapping UID should differ from the current one, current UID `{}`, new UID `{}`","messagePattern":"new doc mapping UID should differ from the current one, current UID `(.+?)`, new UID `(.+?)`","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"quickwit/quickwit-config/src/index_config/mod.rs","lineNumber":728,"sourceCode":"///    - The tokenizers should be a superset of the current tokenizers\n///    - A doc mapper can be built from the new doc mapping\npub fn prepare_doc_mapping_update(\n    mut new_doc_mapping: DocMapping,\n    current_doc_mapping: &DocMapping,\n    search_settings: &SearchSettings,\n) -> anyhow::Result<(DocMapping, bool)> {\n    // Save the new doc mapping UID in a temporary variable and override it with the current doc\n    // mapping UID to compare the two doc mappings, ignoring their UIDs.\n    let new_doc_mapping_uid = new_doc_mapping.doc_mapping_uid;\n    new_doc_mapping.doc_mapping_uid = current_doc_mapping.doc_mapping_uid;\n\n    if new_doc_mapping == *current_doc_mapping {\n        return Ok((new_doc_mapping, false));\n    }\n    // Restore the new doc mapping UID.\n    new_doc_mapping.doc_mapping_uid = new_doc_mapping_uid;\n\n    ensure!(\n        new_doc_mapping.doc_mapping_uid != current_doc_mapping.doc_mapping_uid,\n        \"new doc mapping UID should differ from the current one, current UID `{}`, new UID `{}`\",\n        current_doc_mapping.doc_mapping_uid,\n        new_doc_mapping.doc_mapping_uid,\n    );\n    let new_timestamp_field = new_doc_mapping.timestamp_field.as_deref();\n    let current_timestamp_field = current_doc_mapping.timestamp_field.as_deref();\n    ensure!(\n        new_timestamp_field == current_timestamp_field,\n        \"updating timestamp field is not allowed, current timestamp field `{}`, new timestamp \\\n         field `{}`\",\n        current_timestamp_field.unwrap_or(\"none\"),\n        new_timestamp_field.unwrap_or(\"none\"),\n    );\n    // TODO: Unsure this constraint is required, should we relax it?\n    let new_tokenizers: HashSet<_> = new_doc_mapping.tokenizers.iter().collect();\n    let current_tokenizers: HashSet<_> = current_doc_mapping.tokenizers.iter().collect();\n    ensure!(","sourceCodeStart":710,"sourceCodeEnd":746,"githubUrl":"https://github.com/quickwit-oss/quickwit/blob/a39730c5cdcd1a4fe798403737ae293999ea21f8/quickwit/quickwit-config/src/index_config/mod.rs#L710-L746","documentation":"prepare_doc_mapping_update checks that a doc mapping update is actually a change: every accepted update must bump doc_mapping_uid (a monotonically increasing version). If the proposed mapping has the same UID as the current one, Quickwit rejects it, treating an unchanged UID as an accidental no-op or replayed update rather than silently applying it.","triggerScenarios":"Calling update_index / IndexConfig update path with a new doc mapping whose doc_mapping_uid equals the current one; client code copying the existing mapping without regenerating the UID; replaying a stale update request.","commonSituations":"Automation that patches index config but forgets to increment doc_mapping_uid; resubmitting the same update after a failure without bumping the UID; hand-crafted update payloads in tests/scripts.","solutions":["Assign a new doc_mapping_uid greater than the current one before submitting the update","If using load_index_config_update/from file, ensure the new mapping carries a distinct UID","If the mapping truly did not change, skip the update call entirely"],"exampleFix":"// before\nnew_doc_mapping.doc_mapping_uid = current_doc_mapping.doc_mapping_uid;\n// after\nnew_doc_mapping.doc_mapping_uid = current_doc_mapping.doc_mapping_uid + 1;","handlingStrategy":"validation","validationCode":"// Rust precheck\nassert_ne!(new_doc_mapping.doc_mapping_uid, current_doc_mapping.doc_mapping_uid, \"bump doc_mapping_uid before update\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always increment doc_mapping_uid on every mapping change","Don't resubmit stale update payloads; regenerate the UID each time","Skip the update call when nothing in the mapping changed"],"tags":["config","schema","versioning","validation"],"backgroundTag":"invalid-state-transition","analyzedSha":"a39730c5cdcd1a4fe798403737ae293999ea21f8","analyzedAt":"2026-09-08T13:19:37.784Z","contentChangedAt":"2026-09-08T13:19:37.784Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}