Uh oh!
There was an error while loading. Please reload this page.
HBASE-24382 Flush partial stores of region filtered by seqId when arc… - #1737
Conversation
Apache-HBase
commented
May 19, 2020
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
May 19, 2020
💔 -1 overall
This message was automatically generated. |
Apache9
commented
May 19, 2020
The change is straight forward but I'm not sure whether it is worth to do this optimization, as it does increase the complexity of code. Have you met the problem introduced by the old simple logic? Thanks. |
bsglz
commented
May 19, 2020
It is from a discussion in our team, about whether a table could be set many column family(10~100) or not. |
Apache9
commented
May 19, 2020
OK, sounds reasonable. On the patch, please just use byte[] as the family name? We use byte[] or String as family name everywhere, especially when passing as a parameter, so using ImmutableByteArray seems a bit strange. |
bsglz
commented
May 19, 2020
Ok, will fix tomorrow. |
Apache-HBase
commented
May 19, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
May 19, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
May 19, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
May 19, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
May 20, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
May 20, 2020
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
May 20, 2020
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
May 20, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
May 20, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
May 20, 2020
🎊 +1 overall
This message was automatically generated. |
bsglz
commented
May 20, 2020
@Apache9 Could you help to review it? Thanks. |
Apache9
left a comment
There was a problem hiding this comment.
So why we choose String instead of byte[] here?
| Collection<HStore> specificStoresToFlush = null; | ||
| if (!forceFlushAllStores && families != null) { | ||
| specificStoresToFlush = stores.entrySet().stream() | ||
| .filter(e -> families.contains(Bytes.toString(e.getKey()))) |
There was a problem hiding this comment.
If we want to use contains then we better use a Set instead of a List?
There was a problem hiding this comment.
So why we choose String instead of byte[] here?
1、The family name stored as private byte[] in ImmutableByteArray, if use byte[], it need twice convertion.
2、We use the method of contains to filter them later, use string seems esaliy to do.
Correct me if i have some mistake.
If we want to use contains then we better use a Set instead of a List?
Yeah, you are right, will fix.
Thanks a lot.
There was a problem hiding this comment.
If the String is ok, i will push a commit later, or else i will research more.
Thanks.
There was a problem hiding this comment.
In the WAL interface, we all use byte[] as family name, so I prefer we also use byte[] here. You could use TreeSet with BytesComparator to hold byte[].
There was a problem hiding this comment.
Ok, will use byte[] instead of String.
In addition,since we do not need a sorted collection, i could iterate the families to avoid use contains.
Thanks.
Apache-HBase
commented
May 21, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
May 21, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
May 21, 2020
🎊 +1 overall
This message was automatically generated. |
bsglz
commented
May 23, 2020
rebase |
| @@ -59,7 +61,7 @@ protected void scheduleFlush(String encodedRegionName) { | |||
| return; | |||
| } | |||
| // force flushing all stores to clean old logs | |||
| for (Map.Entry<ImmutableByteArray, Long> me : m.entrySet()) { | ||
| if (me.getValue() <= e.getValue()) { | ||
| if (toFlush == null) { | ||
| toFlush = new HashMap<>(); |
There was a problem hiding this comment.
Better use a TreeMap with BytesComparator?
Apache-HBase
commented
May 23, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
May 23, 2020
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
May 23, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
May 23, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
May 23, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Jun 9, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Jun 9, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Jun 9, 2020
🎊 +1 overall
This message was automatically generated. |
saintstack
commented
Jun 9, 2020
FlushPolicy does seem to cut across what you are trying to do here where you only flush a subset.... even though reading the original issue, it seems to be trying to do subset only: https://issues.apache.org/jira/browse/HBASE-10201 We should change flushpolicy to accommodate your need? If we flush all regardless of the policy, that sounds like a problem. Thanks. |
bsglz
commented
Jun 10, 2020
Skimed HBASE-10201, still can not get the point that how to change the flushpolicy... |
bsglz
commented
Jun 16, 2020
@saintstack Ping |
Apache9
left a comment
There was a problem hiding this comment.
I'm fine with the approach but I guess there are still checkstyle issues? Please fix them before merging.
Thanks.
| */ | ||
| package org.apache.hadoop.hbase.regionserver; | ||
| import java.util.ArrayList; |
There was a problem hiding this comment.
Should remove these imports? Seems we add a method in this class and then moved it out but forgot to remove these imports?
There was a problem hiding this comment.
Oh, you are right, fixed.
Thanks.
Apache-HBase
commented
Jun 23, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Jun 23, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Jun 23, 2020
🎊 +1 overall
This message was automatically generated. |
saintstack
commented
Jun 25, 2020
bq. The former is about how to select stores that could be flushed, and the latter is about select stores that must be flushed. Ok. Did you stamp this into the code as comments? Let me look. |
bsglz
commented
Jun 25, 2020
Will do it later, thanks. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| // force flushing all stores to clean old logs | ||
| requester.requestFlush(r, true, FlushLifeCycleTracker.DUMMY); | ||
| // force flushing specified stores to clean old logs | ||
| requester.requestFlush(r, false, families, FlushLifeCycleTracker.DUMMY); |
There was a problem hiding this comment.
The flag is set when we are in a critical condition -- the WAL count is in excess of our WAL limit. The flag's intent IIRC is that we flush all stores regardless of what determination is made at flush time as to which stores are in need of flush or not; the old edit may actually be hanging out in a store that is small and not in need of flush normally or in accordance w/ some flush policy. The flag says 'force' the flush. My understanding is that this is a FlushRequest usually but the flag changes the request to a demand.
Here you are passing a set of stores instead where the stores chosen are the ones that will free up WALs. So, this flag is now redundant? We should purge it. Now it will confuse since the 'force' instead is a list of families to flush -- else its null if old behavior.
| // force flushing all stores to clean old logs | ||
| requester.requestFlush(r, true, FlushLifeCycleTracker.DUMMY); | ||
| // force flushing specified stores to clean old logs | ||
| requester.requestFlush(r, false, families, FlushLifeCycleTracker.DUMMY); |
There was a problem hiding this comment.
Looking around, this is the only time forceFlushAllStores is set to true -- when we have too many WALs and we need to clear the old ones out.
bsglz
commented
Jun 25, 2020
It also set to true in RSRpcServices.flushRegion, would be called by user. |
bsglz
commented
Jun 25, 2020
Yeah, i am agree with you, maybe the forceFlushAllStores should be enum, named selectType that include "FORCE_ALL","FORCE_WITH_SPECIFIED","FLUSH_POLICY"? And it is a long story yet, i can do it in follow-on jira, WDYT? |
Apache-HBase
commented
Jun 25, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Jun 25, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Jun 25, 2020
🎊 +1 overall
This message was automatically generated. |
saintstack
commented
Jun 25, 2020
bq. It also set to true in RSRpcServices.flushRegion, would be called by user. ok. The user is asking to flush all regions. If user sets it, could convert it to a list of all families? bq. Yeah, i am agree with you, maybe the forceFlushAllStores should be enum, named selectType that include "FORCE_ALL","FORCE_WITH_SPECIFIED","FLUSH_POLICY"? And it is a long story yet, i can do it in follow-on jira, WDYT? Why not just remove it? The above seems to be offering too much choice. Navigating all of the options in flushcache will be awkward. Thanks. |
bsglz
commented
Jun 25, 2020
Ok, remove it make sense, let me do it later. |
… how to select stores to flush
Apache-HBase
commented
Jun 25, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Jun 25, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Jun 25, 2020
🎊 +1 overall
This message was automatically generated. |
| families.addAll(this.getTableDescriptor().getColumnFamilyNames()); | ||
| } | ||
| return this.flushcache(families, writeFlushRequestWalMarker, tracker); | ||
| } |
bsglz
commented
Jun 26, 2020
Thanks all the comments. |
…hive wal due to too many wals