Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip task validation during table creation with schema #14683

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xiangfu0
Copy link
Contributor

@xiangfu0 xiangfu0 commented Dec 18, 2024

How to reproduce:
Create a realtime table along with schema using the pinot-admin AddTable command. The table config should contain the task: RealtimeToOfflineSegmentsTask.

Reason:
For the table creation with schema, the task config validation might fail due to some tasks validation requires schema which is null when calling from the zookeeper.

The fix is to skip the task validation before the schema upload then validate it again.

The ultimate fix is to change the TaskGenerator interface to put both schema and tableConfig in it.

@codecov-commenter
Copy link

codecov-commenter commented Dec 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.07%. Comparing base (59551e4) to head (f14dc59).
Report is 1493 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #14683      +/-   ##
============================================
+ Coverage     61.75%   64.07%   +2.31%     
- Complexity      207     1607    +1400     
============================================
  Files          2436     2706     +270     
  Lines        133233   149164   +15931     
  Branches      20636    22864    +2228     
============================================
+ Hits          82274    95572   +13298     
- Misses        44911    46593    +1682     
- Partials       6048     6999     +951     
Flag Coverage Δ
custom-integration1 100.00% <ø> (+99.99%) ⬆️
integration 100.00% <ø> (+99.99%) ⬆️
integration1 100.00% <ø> (+99.99%) ⬆️
integration2 0.00% <ø> (ø)
java-11 64.03% <100.00%> (+2.32%) ⬆️
java-21 63.90% <100.00%> (+2.28%) ⬆️
skip-bytebuffers-false 64.05% <100.00%> (+2.30%) ⬆️
skip-bytebuffers-true 63.87% <100.00%> (+36.14%) ⬆️
temurin 64.07% <100.00%> (+2.31%) ⬆️
unittests 64.06% <100.00%> (+2.32%) ⬆️
unittests1 56.31% <ø> (+9.42%) ⬆️
unittests2 34.51% <100.00%> (+6.78%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@shounakmk219 shounakmk219 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also handle this case in /tableConfigs/validate endpoint. But problem there is we cannot revalidate it as schema is never registered.
IMO let's just add the new interface method with schema parameter and deprecate the existing one as its only introduced last month so hopefully the usage is limited

// Skip validate task type for table creation as the schema is not yet registered.
validateConfig(tableConfigs, databaseName, "TASK");
} else {
validateConfig(tableConfigs, databaseName, typesToSkip);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should append ",TASK" here to typesToSkip?
Looks like typesToSkip string is not parsed properly in validateTaskConfigs and assumed that only one type is passed while the endpoint expects comma separated list of types.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, there is only full string match inside, I feel some parsing logic is wrong there.


if (typesToSkip == null) {
// Validate config again with schema for validations requires schema.
validateConfig(tableConfigs, databaseName, null);
Copy link
Collaborator

@shounakmk219 shounakmk219 Dec 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to revert the schema creation upon validation failure as it will fail the request?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, the catch clause will revert.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah sorry missed that

@xiangfu0
Copy link
Contributor Author

We should also handle this case in /tableConfigs/validate endpoint. But problem there is we cannot revalidate it as schema is never registered. IMO let's just add the new interface method with schema parameter and deprecate the existing one as its only introduced last month so hopefully the usage is limited

I'm with you, I think let me make the interface change to allow an optional schema. The validation logic could fetch it from zk if it's null.

@xiangfu0 xiangfu0 force-pushed the skip-table-validation-for-table-creation branch 2 times, most recently from f4bc0fe to 5fce882 Compare December 20, 2024 21:16
@xiangfu0 xiangfu0 force-pushed the skip-table-validation-for-table-creation branch 2 times, most recently from 4036269 to c59305c Compare December 20, 2024 21:22
@xiangfu0 xiangfu0 force-pushed the skip-table-validation-for-table-creation branch from c59305c to f14dc59 Compare December 20, 2024 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants