Refresh ZK metadata when dimension table is updated#8133
Refresh ZK metadata when dimension table is updated#8133richardstartin merged 7 commits intoapache:masterfrom
Conversation
Jackie-Jiang
left a comment
There was a problem hiding this comment.
Good catch!
We can override reloadSegment() method and set the schema to the one passed in.
We also need to change _tableSchema and _primaryKeyColumns to volatile because they can be accessed from a different thread
Actually I think consistency needs to be maintained with the lookup table, so these fields should be updated iff the CAS succeeds. Best way to do this would be to store a volatile wrapper class with all the fields in it, pass the schema and primary key columns into the CAS loop, construct the wrapper then perform the CAS on the wrapper. |
…m/pinot into dimension-table-refresh-metadata
Codecov Report
@@ Coverage Diff @@
## master #8133 +/- ##
=========================================
Coverage ? 71.44%
Complexity ? 4305
=========================================
Files ? 1625
Lines ? 84215
Branches ? 12602
=========================================
Hits ? 60167
Misses ? 19952
Partials ? 4096
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
|
@richardstartin I think I've addressed all your suggestions. Only not sure if I did the right thing for the DimensionTable. |
* Refresh ZK metadata when dimension table is updated * Update DimensionTableDataManagerTest.java * all fields into a volatile class in the CAS loop (as per Richard's feedback) * license missing * Return DimensionTable instead of passing it in * Don't mutate the state of DimensionTable
This PR fixes a problem where if you update a dimension table (e.g. by adding a new column and then uploading a new CSV file), the new column can't be read by the lookup function. Below is the type of error you'll see:
The reason that happens is that
_propertyStoreand_tableSchemainDimensionTableDataManagerdon't get refreshed when theaddSegmentfunction gets called on the refreshing of the dimension table segment.This PR refreshes those fields along with the cached lookup table.
Upgrade Notes
Does this PR prevent a zero down-time upgrade? (Assume upgrade order: Controller, Broker, Server, Minion)
backward-incompat, and complete the section below on Release Notes)Does this PR fix a zero-downtime upgrade introduced earlier?
backward-incompat, and complete the section below on Release Notes)Does this PR otherwise need attention when creating release notes? Things to consider:
release-notesand complete the section on Release Notes)Release Notes
Documentation