From eb1fec1c538b8b25b1d5f9080475ca7f251a51a9 Mon Sep 17 00:00:00 2001 From: WenFeiYi Date: Fri, 27 Mar 2020 10:04:52 +0800 Subject: [PATCH] HBASE-24040 WALFactory.Providers.multiwal causes StackOverflowError (#1338) Signed-off-by: Duo Zhang --- .../org/apache/hadoop/hbase/wal/RegionGroupingProvider.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/RegionGroupingProvider.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/RegionGroupingProvider.java index d6a36421cbd..764d3d521ac 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/RegionGroupingProvider.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/RegionGroupingProvider.java @@ -119,7 +119,7 @@ public class RegionGroupingProvider implements WALProvider { public static final String REGION_GROUPING_STRATEGY = "hbase.wal.regiongrouping.strategy"; public static final String DEFAULT_REGION_GROUPING_STRATEGY = Strategies.defaultStrategy.name(); - /** delegate provider for WAL creation/roll/close */ + /** delegate provider for WAL creation/roll/close, but not support multiwal */ public static final String DELEGATE_PROVIDER = "hbase.wal.regiongrouping.delegate.provider"; public static final String DEFAULT_DELEGATE_PROVIDER = WALFactory.Providers.defaultProvider .name(); @@ -162,6 +162,10 @@ public class RegionGroupingProvider implements WALProvider { } this.strategy = getStrategy(conf, REGION_GROUPING_STRATEGY, DEFAULT_REGION_GROUPING_STRATEGY); this.providerClass = factory.getProviderClass(DELEGATE_PROVIDER, DEFAULT_DELEGATE_PROVIDER); + if (providerClass.equals(this.getClass())) { + LOG.warn("delegate provider not support multiwal, falling back to defaultProvider."); + providerClass = factory.getDefaultProvider().clazz; + } } private WALProvider createProvider(String group) throws IOException {