test(upgrade): cover versioned and unversioned structured properties in ReindexDebug forced rebuilds
When ENABLE_STRUCTURED_PROPERTIES_SYSTEM_UPDATE=true, BuildIndices maps every active structured property explicitly, but ReindexDebug (-u ReindexDebug -a index=<index>) always passes an empty set of structured properties to its steps. With that setting on, the builder does not carry over the current structured property mappings, and because the structuredProperties container is dynamic: false, the forced rebuild creates an index with no mapping for any structured property, so every property's values, including ones that were indexed correctly before, are left unindexed and can no longer be searched or filtered, while the job reports SUCCEEDED. ReindexDebug should rebuild with the same target mappings as BuildIndices. This change loads the active structured property definitions the same way BuildIndices does when that setting is on, and passes them to the pre, reindex and post steps. With the setting off (the default) nothing changes, since the builder already carries over the current mappings there.
Testing
-
New
ReindexDebugTest: with the setting on, a versioned and an unversioned property both reach the forced rebuild (fails without this change); with it off, no definitions are read. -
Manual end-to-end on a local stack built from
masterate77a36dd4833250f319c1a7058f9f2c762ff728a(Elasticsearch 8.19), comparing that commit'sdatahub-upgradewith one built from this PR's commitbfe2f35cd385115154ae04454928bffb311f8b3a, with the setting on and a dataset index holding values for a versioned and an unversioned string property. Ran-u ReindexDebug -a index=datasetindex_v2:- Before this change: the run reported
SUCCEEDED, but the rebuilt index had no mapping for either property, and a term query on each returned 0 hits (1 before the run). - With this change: both properties were mapped in the rebuilt index, and each term query returned its 1 hit. A versioned property whose field had been dynamically mapped as
textcame back askeyword.
- Before this change: the run reported
-
The PR conforms to DataHub's Contributing Guideline (particularly PR Title Format)
-
Links to related issues (if applicable)
-
Tests for the changes have been added/updated (if applicable)
-
Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
-
For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub
🤖 Generated with Claude Code
Summary by cubic
Fixes ReindexDebug forced rebuilds dropping all structured property mappings when ENABLE_STRUCTURED_PROPERTIES_SYSTEM_UPDATE=true. The rebuilt index had no mapping for any structured property, leaving their values unindexed and unsearchable while the job reported SUCCEEDED. The upgrade now loads active structured property definitions the same way BuildIndices does and passes them to the pre, reindex, and post steps. With the setting off (the default), behavior is unchanged.
Adds ReindexDebugTest verifying that a versioned and an unversioned property both reach the forced rebuild when the setting is on, and that no definitions are read when it's off.