[ 
https://issues.apache.org/jira/browse/HBASE-28241?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17793127#comment-17793127
 ] 

ruanhui edited comment on HBASE-28241 at 12/5/23 9:35 AM:
----------------------------------------------------------

In the SnapshotManager, we have two methods
{code:java}
public boolean isTakingSnapshot(final TableName tableName) {
  return isTakingSnapshot(tableName, /* checkProcedure= */false);
}

public boolean isTableTakingAnySnapshot(final TableName tableName) {
  return isTakingSnapshot(tableName, /* checkProcedure= */ true);
} {code}
 

Currently the SplitTableRegionProcedure and MergeTableRegionProcedure calls the 
first method because we used to think that spliting/merging region procedure 
and snapshoting region procedure were not mutually exclusive. But actually it 
do causes some problems. We should call the second one ? Let me design an UT to 
verify it.


was (Author: frostruan):
In the SnapshotManager, we have two methods
{code:java}
public boolean isTakingSnapshot(final TableName tableName) {
  return isTakingSnapshot(tableName, /* checkProcedure= */false);
}

public boolean isTableTakingAnySnapshot(final TableName tableName) {
  return isTakingSnapshot(tableName, /* checkProcedure= */ true);
} {code}
 

Currently the SplitTableRegionProcedure and MergeTableRegionProcedure calls the 
first method because we used to think that spliting/merging region procedure 
and snapshoting region procedure were not mutually exclusive. But actually it 
do causes some problems. We should calls the second one ? Let me design an UT 
to verify it.

> The snapshot operation encountered an NPE and failed.
> -----------------------------------------------------
>
>                 Key: HBASE-28241
>                 URL: https://issues.apache.org/jira/browse/HBASE-28241
>             Project: HBase
>          Issue Type: Bug
>    Affects Versions: 3.0.0-beta-1
>            Reporter: Haiping lv
>            Assignee: Haiping lv
>            Priority: Major
>
> Executing a merge region before the snapshot operation is completed will 
> result in an NPE error for the snapshot operation and cause it to fail
> Triggering logic
>  # Execute the snapshot command.
>  # Merge regions before the snapshot is completed.
>  # After the merge is completed, the two parent regions will be cleaned up.
>  # An NPE will be reported when the snapshot operation is performed on that 
> parent region. The log is as follow:
> {code:java}
> 2023-11-20T23:26:07,061 ERROR [PEWorker-13] procedure2.ProcedureExecutor: 
> CODE-BUG: Uncaught runtime exception: pid=238720, ppid=238714, 
> state=RUNNABLE, hasLock=true; SnapshotRegionProcedure 
> c47539f1d6032ba1a037f5279c22baa0
> java.lang.NullPointerException: null
>         at 
> org.apache.hadoop.hbase.master.procedure.SnapshotRegionProcedure.execute(SnapshotRegionProcedure.java:160)
>  ~[hbase-server-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]
>         at 
> org.apache.hadoop.hbase.master.procedure.SnapshotRegionProcedure.execute(SnapshotRegionProcedure.java:58)
>  ~[hbase-server-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]
>         at 
> org.apache.hadoop.hbase.procedure2.Procedure.doExecute(Procedure.java:921) 
> ~[hbase-procedure-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]
>         at 
> org.apache.hadoop.hbase.procedure2.ProcedureExecutor.execProcedure(ProcedureExecutor.java:1649)
>  ~[hbase-procedure-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]
>         at 
> org.apache.hadoop.hbase.procedure2.ProcedureExecutor.executeProcedure(ProcedureExecutor.java:1395)
>  ~[hbase-procedure-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]
>         at 
> org.apache.hadoop.hbase.procedure2.ProcedureExecutor.access$1000(ProcedureExecutor.java:75)
>  ~[hbase-procedure-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]
>         at 
> org.apache.hadoop.hbase.procedure2.ProcedureExecutor$WorkerThread.runProcedure(ProcedureExecutor.java:1961)
>  ~[hbase-procedure-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]
>         at org.apache.hadoop.hbase.trace.TraceUtil.trace(TraceUtil.java:216) 
> ~[hbase-common-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]
>         at 
> org.apache.hadoop.hbase.procedure2.ProcedureExecutor$WorkerThread.run(ProcedureExecutor.java:1988)
>  ~[hbase-procedure-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT] {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to