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

PHOENIX-5645 - GlobalIndexChecker should prevent compaction from purg… #662

Merged
merged 2 commits into from Jan 13, 2020

Conversation

gjacoby126
Copy link
Contributor

…ing very recently deleted cells

@gjacoby126
Copy link
Contributor Author

Note that the new test I just pushed up to verify TTL behavior is currently failing.

import org.apache.hadoop.hbase.regionserver.Region;
import org.apache.hadoop.hbase.regionserver.RegionScanner;
import org.apache.hadoop.hbase.regionserver.ScanInfo;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: are these imports used in this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, removed them.

}

@Override
public InternalScanner preCompactScannerOpen(
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a lot of commonality in the function body of the above two hooks. Is it possible to throw that in a common function and invoke it from both the hooks?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought of that, but they're just a bit different and some of the differences were in the middle, so I didn't see an easy way to consolidate. If you do please let me know -- always nice to eliminate dupes.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it is more like readability vs DRY. We could put everything into a function and have a boolean passed but I think conditionals make things more complicated.

ScanInfo scanInfo =
ScanInfoUtil.getScanInfoForFlushesAndCompactions(conf, oldScanInfo,
store, scanType);
return new StoreScanner(store, scanInfo, scan, scanners, scanType,
Copy link
Contributor

Choose a reason for hiding this comment

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

unrelated to this PR. @gjacoby126 @abhishek-chouhan Looking at StoreScanner, seems like a scope to refactor the class into using the builder pattern. Any thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The builder pattern would improve the StoreScanner's readability, yes, though since StoreScanner's IA.Private and really only supposed to be used within HBase, it would be to improve the HBase codebase more than Phoenix. Hopefully in the medium term we can get HBASE-23602 done so that we have a higher-level, supported way to do this.

ScanInfo oldScanInfo = store.getScanInfo();

Configuration conf = c.getEnvironment().getConfiguration();
//minor compactions and flushes both use "compact retain deletes"
Copy link
Contributor

Choose a reason for hiding this comment

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

as per the comment here, should line 440 also be in other hook?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Compactions already set the scan type in the hook via the passed in parameter.

try (Connection conn = DriverManager.getConnection(getUrl())) {
String dataTableName = generateUniqueName();
String indexStem = generateUniqueName();
createTableAndIndexes(conn, dataTableName, indexStem);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: You seem to be creating dataTable and indexes in each of these tests. Recommend you to move it to a @before method

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately the tables are slightly different each time.

Copy link
Contributor

@kadirozde kadirozde left a comment

Choose a reason for hiding this comment

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

+1, Thanks

@gjacoby126 gjacoby126 merged commit a37980c into apache:4.x-HBase-1.5 Jan 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants