-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-23181 Blocked WAL archive: "LogRoller: Failed to schedule flush of XXXX, because it is not online on us" #739
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,14 +51,16 @@ class FSWALEntry extends Entry { | |
| // they are only in memory and held here while passing over the ring buffer. | ||
| private final transient long txid; | ||
| private final transient boolean inMemstore; | ||
| private final transient boolean closeRegion; | ||
| private final transient RegionInfo regionInfo; | ||
| private final transient Set<byte[]> familyNames; | ||
| private final transient ServerCall<?> rpcCall; | ||
|
|
||
| FSWALEntry(final long txid, final WALKeyImpl key, final WALEdit edit, final RegionInfo regionInfo, | ||
| final boolean inMemstore, ServerCall<?> rpcCall) { | ||
| final boolean inMemstore, boolean closeRegion, ServerCall<?> rpcCall) { | ||
| super(key, edit); | ||
| this.inMemstore = inMemstore; | ||
| this.closeRegion = closeRegion; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we have to add a flag? See WALUtil where we have createFlushWALEdit which uses special family and qualifier to denote an edit a FLUSH edit. Could do same here and skip the extra flag? |
||
| this.regionInfo = regionInfo; | ||
| this.txid = txid; | ||
| if (inMemstore) { | ||
|
|
@@ -98,6 +100,10 @@ boolean isInMemStore() { | |
| return this.inMemstore; | ||
| } | ||
|
|
||
| boolean isCloseRegion() { | ||
| return closeRegion; | ||
| } | ||
|
|
||
| RegionInfo getRegionInfo() { | ||
| return this.regionInfo; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,6 +28,7 @@ | |
| import java.util.Set; | ||
| import java.util.concurrent.ConcurrentHashMap; | ||
| import java.util.concurrent.ConcurrentMap; | ||
| import java.util.stream.Collectors; | ||
| import org.apache.hadoop.hbase.HConstants; | ||
| import org.apache.hadoop.hbase.util.Bytes; | ||
| import org.apache.hadoop.hbase.util.ImmutableByteArray; | ||
|
|
@@ -184,6 +185,30 @@ void update(byte[] encodedRegionName, Set<byte[]> families, long sequenceid, | |
| } | ||
| } | ||
|
|
||
| /** | ||
| * Clear all the records of the given region as it is going to be closed. | ||
| * <p/> | ||
| * We will call this once we get the region close marker. We need this because that, if we use | ||
| * Durability.ASYNC_WAL, after calling startCacheFlush, we may still get some ongoing wal entries | ||
| * that has not been processed yet, this will lead to orphan records in the | ||
| * lowestUnflushedSequenceIds and then cause too many WAL files. | ||
| * <p/> | ||
| * See HBASE-23157 for more details. | ||
| */ | ||
| void onRegionClose(byte[] encodedRegionName) { | ||
| synchronized (tieLock) { | ||
| this.lowestUnflushedSequenceIds.remove(encodedRegionName); | ||
| Map<ImmutableByteArray, Long> flushing = this.flushingSequenceIds.remove(encodedRegionName); | ||
| if (flushing != null) { | ||
| LOG.warn("Still have flushing records when closing {}, {}", | ||
| Bytes.toString(encodedRegionName), | ||
| flushing.entrySet().stream().map(e -> e.getKey().toStringBinary() + "->" + e.getValue()) | ||
| .collect(Collectors.joining(",", "{", "}"))); | ||
| } | ||
| } | ||
| this.highestSequenceIds.remove(encodedRegionName); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good. This is like the purge method over in HBASE-23181. |
||
| } | ||
|
|
||
| /** | ||
| * Update the store sequence id, e.g., upon executing in-memory compaction | ||
| */ | ||
|
|
||
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.
Just make this a toString rather than add a new method?