Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import org.apache.hadoop.hbase.master.procedure.MasterProcedureUtil;
import org.apache.hadoop.hbase.procedure2.ProcedureMetrics;
import org.apache.hadoop.hbase.procedure2.ProcedureStateSerializer;
import org.apache.hadoop.hbase.quotas.MasterQuotaManager;
import org.apache.hadoop.hbase.quotas.QuotaExceededException;
import org.apache.hadoop.hbase.regionserver.HRegionFileSystem;
import org.apache.hadoop.hbase.regionserver.HStoreFile;
Expand Down Expand Up @@ -540,7 +541,10 @@ private void preMergeRegions(final MasterProcedureEnv env) throws IOException {
}
// TODO: Clean up split and merge. Currently all over the place.
try {
env.getMasterServices().getMasterQuotaManager().onRegionMerged(this.mergedRegion);
MasterQuotaManager masterQuotaManager = env.getMasterServices().getMasterQuotaManager();
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @mnpoonia in which case are you seeing this NPE? Master is starting up and quotas has not yet initialized?

Copy link
Contributor Author

@mnpoonia mnpoonia Oct 22, 2024

Choose a reason for hiding this comment

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

@NihalJain You are right. A Master was in transition when we got this exception. It was trying to become active. Sequence of events were as noted below for reference

2024-10-14 20:02:11,265 ERROR [PEWorker-31] procedure2.ProcedureExecutor - CODE-BUG: Uncaught runtime exception: pid=58745238, state=RUNNABLE:SPLIT_TABLE_REGION_PRE_OPERATION, locked=true; SplitTableRegionProcedure table=Table1, parent=36dcdeb9044bd0ece2eb046cf7fd7c2f, daughterA=cfba8d001ef9d3640060a4e845d3d013, daughterB=0becd69b7ccdc7e12dcc96cc637dc300
java.lang.NullPointerException

2024-10-14 20:02:11,269 INFO  [aster/hmaster-1:61000:becomeActiveMaster] quotas.MasterQuotaManager - Quota support disabled

if (masterQuotaManager != null) {
masterQuotaManager.onRegionMerged(this.mergedRegion);
}
} catch (QuotaExceededException e) {
// TODO: why is this here? merge requests can be submitted by actors other than the normalizer
env.getMasterServices().getRegionNormalizerManager()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
import org.apache.hadoop.hbase.master.procedure.MasterProcedureUtil;
import org.apache.hadoop.hbase.procedure2.ProcedureMetrics;
import org.apache.hadoop.hbase.procedure2.ProcedureStateSerializer;
import org.apache.hadoop.hbase.quotas.MasterQuotaManager;
import org.apache.hadoop.hbase.quotas.QuotaExceededException;
import org.apache.hadoop.hbase.regionserver.HRegionFileSystem;
import org.apache.hadoop.hbase.regionserver.HStore;
Expand Down Expand Up @@ -601,7 +602,10 @@ private void preSplitRegion(final MasterProcedureEnv env)
// TODO: Clean up split and merge. Currently all over the place.
// Notify QuotaManager and RegionNormalizer
try {
env.getMasterServices().getMasterQuotaManager().onRegionSplit(this.getParentRegion());
MasterQuotaManager masterQuotaManager = env.getMasterServices().getMasterQuotaManager();
if (masterQuotaManager != null) {
masterQuotaManager.onRegionSplit(this.getParentRegion());
}
} catch (QuotaExceededException e) {
// TODO: why is this here? split requests can be submitted by actors other than the normalizer
env.getMasterServices().getRegionNormalizerManager()
Expand Down