[bugfix] scope cluster-aware tableConfigs validations to validate/tune endpoints only#18580
Open
shounakmk219 wants to merge 1 commit into
Open
[bugfix] scope cluster-aware tableConfigs validations to validate/tune endpoints only#18580shounakmk219 wants to merge 1 commit into
shounakmk219 wants to merge 1 commit into
Conversation
…e endpoints only PR apache#16675 placed the new TENANT/MINION_INSTANCES/ACTIVE_TASKS checks inside the shared private validateConfig helper, so they leaked onto the create and update paths. Move them into a new helper invoked only from parseAndValidateTableConfigs (the validate/tune flow). This restores update flow behavior (active-task check no longer blocks updates), drops the duplicate tableTasksValidation/tenant/minion calls on create, and keeps the PR's intent of fail-fast pre-flight feedback on /tableConfigs/validate and /tableConfigs/tune intact. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #18580 +/- ##
============================================
+ Coverage 64.28% 64.30% +0.02%
Complexity 1137 1137
============================================
Files 3335 3335
Lines 205895 205903 +8
Branches 32129 32126 -3
============================================
+ Hits 132359 132406 +47
+ Misses 62888 62865 -23
+ Partials 10648 10632 -16
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes regressions introduced by #16675 in
TableConfigsRestletResource.That PR added three new cluster-aware validation types —
TENANT,MINION_INSTANCES,ACTIVE_TASKS— to enhance the/tableConfigs/validateendpoint (its stated intent). However, it wired them into the shared privatevalidateConfig(TableConfigs, String, String)helper, which is also called from the create (POST /tableConfigs) and update (PUT /tableConfigs/{tableName}) endpoints. This leaked the new checks onto paths where they don't belong.Regressions observed
updateConfig(PUT/tableConfigs/{tableName})tableTasksValidationnow runs on every update; it throws if any task exists for the table, so any config update is blocked while tasks are in the queue. The active-task check is only intended for create (catches stale state) and delete (blocks deleting with running tasks). The siblingPinotTableRestletResource.updateTableConfigatPUT /tables/{tableName}correctly does not gate updates this way.addConfig(POST/tableConfigs)tableTasksValidationis called twice for offline / realtime configs — once via the new block in the shared helper and again at the inline call sites inaddConfig.addConfig@QueryParam("ignoreActiveTasks")flag is bypassed by the new call site; the helper gates only on theACTIVE_TASKSskip type, soignoreActiveTasks=trueno longer suppresses the active-task check by itself — clients that relied on it broke.addConfigvalidateTableTenantConfig+validateTableTaskMinionInstanceTagConfignow run twice — once via the new helper, and again insidePinotHelixResourceManager.addTable(...).updateConfigPinotHelixResourceManager.updateTableConfig(...).R1–R3 are behavioral regressions affecting users; R4/R5 are duplicated Helix/ZK calls per request.
Fix
Keep the PR's intent (
/tableConfigs/validateand/tableConfigs/tunesurface cluster-aware issues for fail-fast feedback), but stop leaking the new checks onto create/update:validateConfig(TableConfigs, ...)helper.validateClusterAwareConfig(TableConfig, Set<ValidationType>)that runs only the three cluster-aware checks, gated by skip types.parseAndValidateTableConfigs(the path shared byvalidateConfigandtuneConfigendpoints). TheaddConfigandupdateConfigpaths are not touched — they continue to rely on:tableTasksValidationcall inaddConfig(properly gated byignoreActiveTasks).PinotHelixResourceManager.addTable(...)andupdateTableConfig(...)running tenant / minion checks internally (unchanged behavior, no double-call).@ApiParamdoc onaddConfigandupdateConfigback to(ALL|TASK|UPSERT)since those endpoints don't consume the new skip types. The validate/tune endpoints keep the expanded doc.Net effect:
/tableConfigs/validateand/tableConfigs/tunebehave identically to #16675.addConfigandupdateConfigare restored to their pre-#16675 behavior.Test plan
./mvnw -pl pinot-controller -am compile— succeeds./mvnw spotless:apply checkstyle:check license:check -pl pinot-controller— all cleanTableConfigsRestletResourceTest#testValidateConfigWithClusterValidationSkipTypesandtestValidateConfigClusterValidationsEnabled(2 run, 0 failures)taskConfig+ running task →PUT /tableConfigs/{tableName}succeeds (pre-fix: blocked with "dangling task data")POST /tableConfigs?ignoreActiveTasks=truesucceeds without also needingvalidationTypesToSkip=ACTIVE_TASKS🤖 Generated with Claude Code