[ https://issues.apache.org/jira/browse/HBASE-28956?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Wellington Chevreuil resolved HBASE-28956. ------------------------------------------ Resolution: Fixed Merged to master, branch-3, branch-2, branch-2.6 and branch-2.5. Thanks for the contribution [~guluo] ! > RSMobFileCleanerChore may close the StoreFileReader object which is being > used by Compaction thread > --------------------------------------------------------------------------------------------------- > > Key: HBASE-28956 > URL: https://issues.apache.org/jira/browse/HBASE-28956 > Project: HBase > Issue Type: Bug > Components: Compaction, mob > Affects Versions: 3.0.0-beta-1, 2.7.0, 2.6.1, 2.5.10 > Reporter: guluo > Assignee: guluo > Priority: Major > Labels: pull-request-available > Fix For: 3.0.0, 2.7.0, 2.5.11, 2.6.2 > > > For MOB table, RSMobFileCleanerChore is responsible for cleaning MOB files > that are no longer referebced by the region located in the current > RegionServer. > RSMobFileCleanerChore get the the information of MOB files by reading the > storefile, as fallow. > ```java > // RSMobFileCleanerChore.chore() > sf.initReader(); > byte[] mobRefData = sf.getMetadataValue(HStoreFile.MOB_FILE_REFS); > byte[] bulkloadMarkerData = sf.getMetadataValue(HStoreFile.BULKLOAD_TASK_KEY); > // close store file to avoid memory leaks > sf.closeStoreFile(true); > ``` > There is an issue in here, if the StoreFileReader was not created by > RSMobFileCleanerChore, but RSMobFileCleanerChore closed it, which will cause > the thread that created the object to be unusable, resuting ERROR finally. > > Reproduction: > This is an occasional problem, but the probability of its occurrence can be > increased by making the following modifications. > 1. Setting hbase.master.mob.cleaner.period from 24h to 10s, and restart hbase. > 2. Puting some mob data into a MOB table. > 3. At the same time, executing compaction command for the MOB table, and it > is possible that this problem may occur. > > The error logs as follow. > ERROR: java.io.IOException: Cannot invoke > "org.apache.hadoop.hbase.regionserver.StoreFileReader.getMaxTimestamp()" > because the return value of > "org.apache.hadoop.hbase.regionserver.HStoreFile.getReader()" is null > at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:512) > at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:124) > at org.apache.hadoop.hbase.ipc.RpcHandler.run(RpcHandler.java:102) > at org.apache.hadoop.hbase.ipc.RpcHandler.run(RpcHandler.java:82) > Caused by: java.lang.NullPointerException: Cannot invoke > "org.apache.hadoop.hbase.regionserver.StoreFileReader.getMaxTimestamp()" > because the return value of > "org.apache.hadoop.hbase.regionserver.HStoreFile.getReader()" is null > at > org.apache.hadoop.hbase.regionserver.DefaultStoreFileManager.lambda$getUnneededFiles$3(DefaultStoreFileManager.java:235) -- This message was sent by Atlassian Jira (v8.20.10#820010)