-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
base: master
Are you sure you want to change the base?
Skip task validation during table creation with schema #14683
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this 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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah sorry missed that
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. |
f4bc0fe
to
5fce882
Compare
4036269
to
c59305c
Compare
c59305c
to
f14dc59
Compare
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.