-
Notifications
You must be signed in to change notification settings - Fork 3.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
HBASE-27484 FNFE on StoreFileScanner after a flush followed by a compaction #4882
Conversation
…action Change-Id: I6d31a361f0198d0527d2a41309fc90950cf0cd76
💔 -1 overall
This message was automatically generated. |
@@ -961,10 +961,10 @@ public List<KeyValueScanner> getScanners(boolean cacheBlocks, boolean usePread, | |||
storeFilesToScan = this.storeEngine.getStoreFileManager().getFilesForScan(startRow, | |||
includeStartRow, stopRow, includeStopRow); | |||
memStoreScanners = this.memstore.getScanners(readPt); | |||
storeFilesToScan.stream().forEach(f->f.getReader().incrementRefCount()); |
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.
Is it possible that the storefiles are deleted before we increment ref count here?
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 are inside a storeEngine.readLock here. The delete code also is under the same lock, so if we reach this point, we are sure the files were not deleted yet.
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.
Then there is no problem for the old code either? Since we are under the lock? I do not fully get the point why here we could fix the problem? Mind adding more comment in the code? Thanks.
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.
OK, we will release the lock immediately after getting the file list, so when we actually get the store file scanner, the file may have already been archived.
I think a simple fix is to just move the getting scanner code into the read lock section? As here you only increase the lock if the reader is not null, it is still possible that some files are archived later?
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 one problem of moving the getting scanner code into the read lock section is that in StoreFileScanner.getScannersForStoreFiles
method , it would call HStoreFile.initReader
, which would make the storeEngine.readLock
locked somewhat long time? Another option is that since StoreFileReader.refCount
comes from StoreFileInfo.refCount
, we can increase the StoreFileInfo.refCount
by HStoreFile.fileInfo
?
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.
it would call HStoreFile.initReader , which would make the storeEngine.readLock locked somewhat long time? Another option is that since StoreFileReader.refCount comes from StoreFileInfo.refCount, we can increase the StoreFileInfo.refCount by HStoreFile.fileInfo?
Yeah, didn't want to move the SFR/SFS initialisation inside this read lock. I had updated the code to inc refCount via StoreFileInfo, as @comnetwork suggested.
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
Change-Id: I7da97865ba0fc51015db7bbdf92286c643c387c9
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.
lgtm.
Please take a look at the reported checkstyle/spotbugs/javac warnings.
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStore.java
Show resolved
Hide resolved
Change-Id: Ib8d0df078cbb4daca8240792c2cbbfd7dae183bd
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStore.java
Show resolved
Hide resolved
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
…Reader Change-Id: Icca80de53a2021fd5d169cf03525fb6f59a8f874
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
…action (#4882) Signed-off-by: Peter Somogyi <[email protected]>
Sorry a bit late, but at least let's add more comments in code? |
…action (#4882) Signed-off-by: Peter Somogyi <[email protected]>
…action (#4882) Signed-off-by: Peter Somogyi <[email protected]>
…action (apache#4882) Signed-off-by: Peter Somogyi <[email protected]> (cherry picked from commit 6e562bb) Change-Id: I49a5514b3183017eb245e879fd1d6cc1885f88b6
No description provided.