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
Conversation
29bc10e
to
d7450d2
Compare
Note that the new test I just pushed up to verify TTL behavior is currently failing. |
d7450d2
to
02cb7ba
Compare
import org.apache.hadoop.hbase.regionserver.Region; | ||
import org.apache.hadoop.hbase.regionserver.RegionScanner; | ||
import org.apache.hadoop.hbase.regionserver.ScanInfo; |
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.
nit: are these imports used in this file?
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.
Thanks, removed them.
} | ||
|
||
@Override | ||
public InternalScanner preCompactScannerOpen( |
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.
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?
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.
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.
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.
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.
phoenix-core/src/it/java/org/apache/phoenix/end2end/index/GlobalIndexCheckerIT.java
Outdated
Show resolved
Hide resolved
phoenix-core/src/main/java/org/apache/phoenix/coprocessor/BaseScannerRegionObserver.java
Outdated
Show resolved
Hide resolved
phoenix-core/src/main/java/org/apache/phoenix/coprocessor/BaseScannerRegionObserver.java
Outdated
Show resolved
Hide resolved
ScanInfo scanInfo = | ||
ScanInfoUtil.getScanInfoForFlushesAndCompactions(conf, oldScanInfo, | ||
store, scanType); | ||
return new StoreScanner(store, scanInfo, scan, scanners, scanType, |
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.
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?
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.
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.
phoenix-core/src/main/java/org/apache/hadoop/hbase/regionserver/ScanInfoUtil.java
Outdated
Show resolved
Hide resolved
ScanInfo oldScanInfo = store.getScanInfo(); | ||
|
||
Configuration conf = c.getEnvironment().getConfiguration(); | ||
//minor compactions and flushes both use "compact retain deletes" |
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.
as per the comment here, should line 440 also be in other hook?
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.
Compactions already set the scan type in the hook via the passed in parameter.
…ing very recently deleted cells
try (Connection conn = DriverManager.getConnection(getUrl())) { | ||
String dataTableName = generateUniqueName(); | ||
String indexStem = generateUniqueName(); | ||
createTableAndIndexes(conn, dataTableName, indexStem); |
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.
nit: You seem to be creating dataTable and indexes in each of these tests. Recommend you to move it to a @before method
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.
Unfortunately the tables are slightly different each time.
0773996
to
19d1841
Compare
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.
+1, Thanks
…ing very recently deleted cells
…ing very recently deleted cells