Phoenix 6653 Add upgrade tests based on HBase snapshots#1480
Phoenix 6653 Add upgrade tests based on HBase snapshots#1480richardantal wants to merge 2 commits intoapache:masterfrom
Conversation
cbdc45f to
7f824b9
Compare
|
There is a separate PR for pre 4.10 upgrade #1474 |
7f824b9 to
6ab22f0
Compare
stoty
left a comment
There was a problem hiding this comment.
You should either duplicate the template class, and put the test there, or rename it.
Also, I think that instead of committing the snapshot directories directly, storing them as a single zip file, or in a zip file per snapshot, and extracting in the test would be better.
The individial files are not human reabable anyway.
ed33be3 to
183dd8c
Compare
|
(We've had offline discussions about this with Richard, so some context may not be immediately apparent from the patch) You have uncovered two different additional problems here. One is that moveChildLinkConnection doesn't handle namespace mapping. This bugfix may even be split into a separate dependent ticket, if you prefer. The other problem is that moveChildLinkConnection creates a the HBase Connection from a vanilla Configuration object (reading from hbase-site.xml), which doesn't get necessary Config changes that were set by BaseTest/minicluster. Simply copying the ZK quorum from the CQSI connection may get the test to pass, but is not the right way. |
|
|
||
| Configuration conf = HBaseConfiguration.create(); | ||
|
|
||
| Configuration oldconf = HBaseConfiguration.create(config); |
There was a problem hiding this comment.
Simply use
Configuration conf = HBaseConfiguration.create(config);
and you'll automatically get all properties, including ZK.
| * @throws SQLException | ||
| */ | ||
|
|
||
| public static void moveOrCopyChildLinks(PhoenixConnection oldMetaConnection, Map<String, String> options) throws IOException { |
There was a problem hiding this comment.
This is the wrong workaround.
183dd8c to
3788e66
Compare
| TableName sysCat = SchemaUtil.getPhysicalTableName(SYSTEM_CATALOG_NAME, readOnlyProps); | ||
| TableName sysChildLink = SchemaUtil.getPhysicalTableName(SYSTEM_CHILD_LINK_NAME, readOnlyProps); | ||
|
|
||
| LOGGER.info(String.format("SYSTEM CATALOG tabled use for copying child links: %s", sysCat.toString())); |
There was a problem hiding this comment.
Once the testing is done, you may want remove this, or change it to DEBUG level.
stoty
left a comment
There was a problem hiding this comment.
Please also mention the addParentToChildLinks namespace fix in the commit message.
| //Now we can start Phoenix | ||
| setUpTestDriver(new ReadOnlyProps(serverProps.entrySet().iterator()), new ReadOnlyProps(clientProps.entrySet() | ||
| .iterator())); | ||
| assertTrue(true); |
There was a problem hiding this comment.
Is this assertion enough ?
Will the driver throw an exception if there is an upgrade problem ?
There was a problem hiding this comment.
I think, yes
If you see the tests results in my other PR, without the PHOENIX-6754 fix, that fails with
org.apache.phoenix.schema.ColumnNotFoundException: ERROR 504 (42703): Undefined column. columnName=SYSTEM.CATALOG.COLUMN_QUALIFIER
Test run on this one is successful.
Will update this and the other PR, based on the things you suggested but it would be better to merge PHOENIX-6754 before
There was a problem hiding this comment.
That's fine, ping me when the PHOENIX-6754 changes are finished.
There was a problem hiding this comment.
PHOENIX-6754 is finished, but we wanted to run these tests on the change
#1474
3788e66 to
db9f50f
Compare
|
Thank you @stoty for the review and the suggestions, I've updated the log msgs, and added more detail to the commit message. |
db9f50f to
629149d
Compare
| <groupId>org.apache.commons</groupId> | ||
| <artifactId>commons-csv</artifactId> | ||
| </dependency> | ||
| <dependency> |
Corrected the HBase table names based on namespace mapping in moveOrCopyChildLinks during upgrade
629149d to
86d13a0
Compare
stoty
left a comment
There was a problem hiding this comment.
+1 LGTM
but wait for the tests.
|
Thank you @stoty for the reviews, |
Work is still in progress