-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
HBASE-24408 Introduce a general 'local region' to store data on master #1753
Conversation
The implementation is not perfect, as it initialize the store in RegionProcedureStore, and also the HFilePrinter and WALPrinter can not handle more than 1 family correctly. But anyway, it is enough for shipping with 2.3.0, later when we want to store more data in the region, we can refactor the code, maybe in HBASE-24388. |
Another benefit for this patch is that, now HFile will be stored on the root file system instead of wal filesystem, so we can reuse the HFileCleaner instead of creating a new one by our own. And it is also a good news if later we want to implement WAL on a system other than file system. Added a UT called TestLocalRegionOnTwoFileSystems to confirm it. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
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.
Looks great. Some questions.
Another question is those who have deployed tests on branch-2.3 will have to shutdown these tests, remove the procedure store dir and then restart w/ a later version of 2.3 that has this in it? i.e. how to migrate existing 2.3s? A shutdown, remove, and restart seems fine since no 2.3 release as yet.
Good stuff.
...e-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/BaseTimeToLiveFileCleaner.java
Outdated
Show resolved
Hide resolved
...e-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/BaseTimeToLiveFileCleaner.java
Show resolved
Hide resolved
...e-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/BaseTimeToLiveFileCleaner.java
Show resolved
Hide resolved
|
||
private static final String REPLAY_EDITS_DIR = "recovered.wals"; | ||
|
||
private static final String DEAD_WAL_DIR_SUFFIX = "-dead"; |
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.
Whats this?
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.
The "-dead" is just like what we have done when processing dead region servers, where the suffix is '-splitting'. This is to prevent dead master to write procedure data again.
And on the 'recovered.wals' directory, it is used to hold the recovered wal files for the local region. As there is only one region, we do not need to split the wal during recovery, just move it to 'recovered.wals' directory and replay it.
I've explain this in HBASE-23326.
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.
ok
|
||
private static final Logger LOG = LoggerFactory.getLogger(LocalRegion.class); | ||
|
||
private static final String REPLAY_EDITS_DIR = "recovered.wals"; |
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.
What goes here?
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.
See above.
.useHsync(false).ringBufferSlotCount(16).rollPeriodMs(TimeUnit.MINUTES.toMillis(15)) | ||
.archivedWalSuffix(LocalStore.ARCHIVED_WAL_SUFFIX) | ||
.archivedHFileSuffix(LocalStore.ARCHIVED_HFILE_SUFFIX); | ||
REGION = LocalRegion.create(params); |
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.
Good
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.
Are there params to set for local regions walfs and hfilefs?
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.
No, there are set in Configuration.
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.
Where are the keys defined?
...rver/src/main/java/org/apache/hadoop/hbase/procedure2/store/region/RegionProcedureStore.java
Outdated
Show resolved
Hide resolved
hbase-server/src/main/java/org/apache/hadoop/hbase/master/store/LocalStore.java
Show resolved
Hide resolved
Leaving it there or removing it are both fine, if you want to keep the data then just follow the new naming to rename the old directory. We do not change the data format of the region. |
Let me check the failed UTs. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
15f5fc9
to
0f5d045
Compare
🎊 +1 overall
This message was automatically generated. |
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.
Nice cleanup. Thanks for prepping for furture so we can store other entity types locally -- e.g. RootTable -- if needed.
procedureStore = new RegionProcedureStore(this, cleanerPool, | ||
new MasterProcedureEnv.FsUtilsLeaseRecovery(this)); | ||
procedureStore = | ||
new RegionProcedureStore(this, localStore, new MasterProcedureEnv.FsUtilsLeaseRecovery(this)); |
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.
nice
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.
The passing of an already initialized localregion is what is nice.
|| MasterProcedureUtil.validateProcedureWALFilename(file.getName()); | ||
return AbstractFSWALProvider.validateWALFilename(file.getName()) || | ||
MasterProcedureUtil.validateProcedureWALFilename(file.getName()) || | ||
file.getName().endsWith(LocalStore.ARCHIVED_WAL_SUFFIX); | ||
} | ||
|
||
@Override |
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.
Yes. Of course.
|
||
private static final String REPLAY_EDITS_DIR = "recovered.wals"; | ||
|
||
private static final String DEAD_WAL_DIR_SUFFIX = "-dead"; |
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.
ok
} | ||
} | ||
} catch (IOException e) { | ||
LOG.warn("Failed to clean up delete procedures", e); | ||
} | ||
} | ||
} | ||
} |
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.
Nice. This is cleaner w/ the passing in of the local region.
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
#1753) Signed-off-by: stack <stack@apache.org>
#1753) Signed-off-by: stack <stack@apache.org>
* Used for storing data at master side. The data will be stored in a {@link LocalRegion}. | ||
*/ | ||
@InterfaceAudience.Private | ||
public final class LocalStore { |
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.
This class name confuses me. I see now that it uses "store" as a legacy of what was earlier called the "ProcedureStore". The confusion is this: our Regions also have an internal structure called a "Store".
Maybe o.a.h.h.master.store
should now be called o.a.h.h.master.region
. This class is apparently just a delegate to the region instance. Maybe we can rename LocalRegion
to MasterRegion
, do away with this LocalStore
, replace it with a MasterRegionFactory
, and let the caller invoke methods directly on the MasterRegion
.
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.
Sounds fine.
Let me open a new issue for this.
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.
apache#1753) Signed-off-by: stack <stack@apache.org>
apache#1753) Signed-off-by: stack <stack@apache.org>
No description provided.