-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-26246 Persist the StoreFileTracker configurations to TableDescriptor when creating table #3666
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
Conversation
@@ -285,6 +290,13 @@ private void preCreate(final MasterProcedureEnv env) | |||
getTableName(), (newRegions != null ? newRegions.size() : 0)); | |||
} | |||
|
|||
if(StringUtils.isEmpty(tableDescriptor.getValue(TRACK_IMPL))){ |
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.
Seems the formatter file in your IDE is bit strange? Usually we will have a space between 'if' and '('
Oh, wait a minute, the title is to persist the store engine configuration, not only store file tracker. For me, I do not think changing the global StoreEngine implementation should effect the existing tables, they should only effect newly created tables. WDYT @wchevreuil ? |
💔 -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.
There is a pending question so change the state to request changes...
💔 -1 overall
This message was automatically generated. |
Oh yeah, missed that. Let me re-work it accordingly.
Yeah, that's what I was thinking, so only bothered about this in CreateTableProcedure. |
Actually, now got bit confused by "persisting store engine configuration". I thought StoreFileTracker impl config would be interchangeable with StoreEngine, and we really don't want to mess with different StoreFileTracker impl being used by master and RSes operations, so we define table of CF descriptors as a global point. Are you thinking we should actually put the StoreEngine impl config here, and then, each StoreEngine impl would be responsible to configure its StoreFileTracker impl? |
Yes, I was thinking we should store the StoreEngine config as a whole. For example, if we use StripeCompaction in the past but later we change the default config to DateTieredCompaction, should we switch all the tables' config? At least for me, I do not think so.
To store all the necessary configurations to the TableDescriptor. For example, for MigrationStoreFileTracker, we need to store the src and dst store file tracker implementation as well. WDYT? @wchevreuil Thanks. |
… when creating table Change-Id: Ib92f20581493c13bacfb0b3d8464655c868e2d3c
Change-Id: Ic5c5c1f81de2f9bb61b0d9620fd424653672a8f1
Change-Id: Idbe8f528a31bb4de5e1118b573ffe1ad9e291ff0
Change-Id: I4f0f0d18efbf4966444e89fd84969bc231566db0
14aeaff
to
4f4358c
Compare
I agree with this approach. Adds flexibility. And if we then realise there's appeal to allow for changing all tables at once, maybe we can add tooling for this?
I'm not too familiar with the internals of each of these impls, so can't opine much now.
Done.
Makes sense and gives extensibility. I realised StoreFileTracker is tightened to stores, so we may also choose to persist tracker config on CF descriptor. For now, am putting into table, though, as it gives the chance for operators to override it at CF level. Let me know if you feel we should persist at CF descriptor, @Apache9 . |
Change-Id: I2b11319d42a8437803f3bbdad7776c2da5648d30
For me, I think table level is enough. You can not creating a single CF without table. And when adding new CF to an existing table, it will inherit the configurations from table descriptor, unless you specify the configurations in the CF descriptor. It will not be effected by cluster level configurations. The goal here is to prevent data loss when we have different configurations at master or region server side, and also when we change the cluster level default different configurations. Table level is enough~ WDYT? @wchevreuil Thanks. |
🎊 +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.
Overall LGTM.
Please fix your IDE's formatter configuration and try to format the code before committing?
@@ -423,6 +425,10 @@ private void testCloneTableSchema(final TableName tableName, final TableName new | |||
assertEquals(BLOCK_SIZE, newTableDesc.getColumnFamily(FAMILY_1).getBlocksize()); | |||
assertEquals(BLOCK_CACHE, newTableDesc.getColumnFamily(FAMILY_1).isBlockCacheEnabled()); | |||
assertEquals(TTL, newTableDesc.getColumnFamily(FAMILY_1).getTimeToLive()); | |||
//HBASE-26246 introduced persist of store file tracker into table descriptor |
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.
nit: space after '//'
@@ -40,10 +41,13 @@ | |||
public static final String TRACK_IMPL = "hbase.store.file-tracker.impl"; | |||
private static final Logger LOG = LoggerFactory.getLogger(StoreFileTrackerFactory.class); | |||
|
|||
public static Class<? extends StoreFileTracker> getStoreFileTrackerImpl(Configuration conf){ |
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.
nit: space before '{'
@@ -78,6 +82,15 @@ public final void replace(Collection<StoreFileInfo> compactedFiles, | |||
} | |||
} | |||
|
|||
@Override | |||
public void persistConfiguration(TableDescriptorBuilder builder) { | |||
if(StringUtils.isEmpty(builder.getValue(TRACK_IMPL))){ |
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.
nit: space after 'if' and before '{'
@@ -226,6 +228,11 @@ public static void validateTableCreation(final HMaster master, final TableName t | |||
assertTrue("family not found " + family[i], htd.getColumnFamily(Bytes.toBytes(family[i])) != null); | |||
} | |||
assertEquals(family.length, htd.getColumnFamilyCount()); | |||
|
|||
//checks store file tracker impl has been properly set in htd |
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.
nit: space after '//'
💔 -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. |
🎊 +1 overall
This message was automatically generated. |
Oh, the failed UT is not because of your modification here. It should be a problem when introducing the MigrationStoreFileTracker, where we call the wrong create method... Mind take a look at #3665 first? It fixed the problem. Thanks. |
🎊 +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.
+1
Just a minor nits, do not need to format the file header…
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 |
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 is unnecessary?
@@ -54,7 +55,7 @@ public static StoreFileTracker create(Configuration conf, boolean isPrimaryRepli | |||
ColumnFamilyDescriptorBuilder.newBuilder(Bytes.toBytes(family)); | |||
StoreContext ctx = StoreContext.getBuilder().withColumnFamilyDescriptor(fDescBuilder.build()) | |||
.withRegionFileSystem(regionFs).build(); | |||
return StoreFileTrackerFactory.create(conf, TRACK_IMPL, isPrimaryReplica, ctx); | |||
return StoreFileTrackerFactory.create(conf, isPrimaryReplica, ctx); |
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. This is the root cause of the failing UTs.
…iptor when creating table (#3666) Signed-off-by: Duo Zhang <zhangduo@apache.org>
…iptor when creating table (#3666) Signed-off-by: Duo Zhang <zhangduo@apache.org>
…iptor when creating table (#3666) Signed-off-by: Duo Zhang <zhangduo@apache.org>
…iptor when creating table (#3666) Signed-off-by: Duo Zhang <zhangduo@apache.org>
…iptor when creating table (#3666) Signed-off-by: Duo Zhang <zhangduo@apache.org>
…iptor when creating table (#3666) Signed-off-by: Duo Zhang <zhangduo@apache.org>
…iptor when creating table (#3666) Signed-off-by: Duo Zhang <zhangduo@apache.org>
…iptor when creating table (#3666) Signed-off-by: Duo Zhang <zhangduo@apache.org>
…iptor when creating table (#3666) Signed-off-by: Duo Zhang <zhangduo@apache.org>
…iptor when creating table (#3666) Signed-off-by: Duo Zhang <zhangduo@apache.org>
…iptor when creating table (#3666) Signed-off-by: Duo Zhang <zhangduo@apache.org>
…iptor when creating table (#3666) Signed-off-by: Duo Zhang <zhangduo@apache.org>
…iptor when creating table (#3666) Signed-off-by: Duo Zhang <zhangduo@apache.org>
…iptor when creating table (#3666) Signed-off-by: Duo Zhang <zhangduo@apache.org>
…iptor when creating table (#3666) Signed-off-by: Duo Zhang <zhangduo@apache.org>
…iptor when creating table (#3666) Signed-off-by: Duo Zhang <zhangduo@apache.org>
…iptor when creating table (apache#3666) Signed-off-by: Duo Zhang <zhangduo@apache.org>
…iptor when creating table (apache#3666) Signed-off-by: Duo Zhang <zhangduo@apache.org>
…iptor when creating table (apache#3666) Signed-off-by: Duo Zhang <zhangduo@apache.org>
…iptor when creating table (apache#3666) Signed-off-by: Duo Zhang <zhangduo@apache.org>
…others) to branch-2.5 Previous cherry picks: commit 6aaef89 HBASE-26064 Introduce a StoreFileTracker to abstract the store file tracking logic commit 43b40e9 HBASE-25988 Store the store file list by a file apache#3578) commit 6e05376 HBASE-26079 Use StoreFileTracker when splitting and merging apache#3617) commit 090b2fe HBASE-26224 HBASE-26224 Introduce a MigrationStoreFileTracker to support migratin… apache#3656) commit 0ee1689 HBASE-26246 Persist the StoreFileTracker configurations to TableDescriptor when creating table apache#3666) commit 2052e80 HBASE-26248 Should find a suitable way to let users specify the store… apache#3665) commit 5ff0f98 HBASE-26264 Add more checks to prevent misconfiguration on store file… apache#3681) commit fc4f6d1 HBASE-26280 HBASE-26280 Use store file tracker when snapshoting apache#3685) commit 06db852 HBASE-26326 CreateTableProcedure fails when FileBasedStoreFileTracker… apache#3721) commit e4e7cf8 HBASE-26386 Refactor StoreFileTracker implementations to expose the s… apache#3774) commit 08d1171 HBASE-26328 Clone snapshot doesn't load reference files into FILE SFT impl apache#3749) commit 8bec26e HBASE-26263 [Rolling Upgrading] Persist the StoreFileTracker configur… apache#3700) commit a288365 HBASE-26271: Cleanup the broken store files under data directory apache#3786) commit d00b5fa HBASE-26454 CreateTableProcedure still relies on temp dir and renames… apache#3845) commit 771e552 HBASE-26286: Add support for specifying store file tracker when restoring or cloning snapshot commit f16b7b1 HBASE-26265 Update ref guide to mention the new store file tracker im… apache#3942) commit 755b3b4 HBASE-26585 Add SFT configuration to META table descriptor when creating META apache#3998) commit 39c42c7 HBASE-26639 The implementation of TestMergesSplitsAddToTracker is pro… apache#4010) commit 6e1f5b7 HBASE-26586 Should not rely on the global config when setting SFT implementation for a table while upgrading apache#4006) commit f1dd865 HBASE-26654 ModifyTableDescriptorProcedure shoud load TableDescriptor… apache#4034) commit 8fbc9a2 HBASE-26674 Should modify filesCompacting under storeWriteLock apache#4040) commit 5aa0fd2 HBASE-26675 Data race on Compactor.writer apache#4035) commit 3021c58 HBASE-26700 The way we bypass broken track file is not enough in Stor… apache#4055) commit a8b68c9 HBASE-26690 Modify FSTableDescriptors to not rely on renaming when wr… apache#4054) commit dffeb8e HBASE-26587 Introduce a new Admin API to change SFT implementation (#… apache#4080) commit b265fe5 HBASE-26673 Implement a shell command for change SFT implementation apache#4113) commit 4cdb380 HBASE-26640 Reimplement master local region initialization to better … apache#4111) commit 77bb153 HBASE-26707: Reduce number of renames during bulkload (apache#4066) apache#4122) commit a4b192e HBASE-26611 Changing SFT implementation on disabled table is dangerous apache#4082) commit d3629bb HBASE-26837 Set SFT config when creating TableDescriptor in TestClone… apache#4226) commit 541d748 HBASE-26881 Backport HBASE-25368 to branch-2 (apache#4267) Fixups for precommit error prone, checkstyle, and javadoc warnings after applying cherry picks. Signed-off-by: Josh Elser <elserj@apache.org> Reviewed-by: Wellington Ramos Chevreuil <wchevreuil@apache.org>
…iptor when creating table (#3666) Signed-off-by: Duo Zhang <zhangduo@apache.org>
…others) to branch-2.5 Previous cherry picks: commit 6aaef89 HBASE-26064 Introduce a StoreFileTracker to abstract the store file tracking logic commit 43b40e9 HBASE-25988 Store the store file list by a file #3578) commit 6e05376 HBASE-26079 Use StoreFileTracker when splitting and merging #3617) commit 090b2fe HBASE-26224 HBASE-26224 Introduce a MigrationStoreFileTracker to support migratin… #3656) commit 0ee1689 HBASE-26246 Persist the StoreFileTracker configurations to TableDescriptor when creating table #3666) commit 2052e80 HBASE-26248 Should find a suitable way to let users specify the store… #3665) commit 5ff0f98 HBASE-26264 Add more checks to prevent misconfiguration on store file… #3681) commit fc4f6d1 HBASE-26280 HBASE-26280 Use store file tracker when snapshoting #3685) commit 06db852 HBASE-26326 CreateTableProcedure fails when FileBasedStoreFileTracker… #3721) commit e4e7cf8 HBASE-26386 Refactor StoreFileTracker implementations to expose the s… #3774) commit 08d1171 HBASE-26328 Clone snapshot doesn't load reference files into FILE SFT impl #3749) commit 8bec26e HBASE-26263 [Rolling Upgrading] Persist the StoreFileTracker configur… #3700) commit a288365 HBASE-26271: Cleanup the broken store files under data directory #3786) commit d00b5fa HBASE-26454 CreateTableProcedure still relies on temp dir and renames… #3845) commit 771e552 HBASE-26286: Add support for specifying store file tracker when restoring or cloning snapshot commit f16b7b1 HBASE-26265 Update ref guide to mention the new store file tracker im… #3942) commit 755b3b4 HBASE-26585 Add SFT configuration to META table descriptor when creating META #3998) commit 39c42c7 HBASE-26639 The implementation of TestMergesSplitsAddToTracker is pro… #4010) commit 6e1f5b7 HBASE-26586 Should not rely on the global config when setting SFT implementation for a table while upgrading #4006) commit f1dd865 HBASE-26654 ModifyTableDescriptorProcedure shoud load TableDescriptor… #4034) commit 8fbc9a2 HBASE-26674 Should modify filesCompacting under storeWriteLock #4040) commit 5aa0fd2 HBASE-26675 Data race on Compactor.writer #4035) commit 3021c58 HBASE-26700 The way we bypass broken track file is not enough in Stor… #4055) commit a8b68c9 HBASE-26690 Modify FSTableDescriptors to not rely on renaming when wr… #4054) commit dffeb8e HBASE-26587 Introduce a new Admin API to change SFT implementation (#… #4080) commit b265fe5 HBASE-26673 Implement a shell command for change SFT implementation #4113) commit 4cdb380 HBASE-26640 Reimplement master local region initialization to better … #4111) commit 77bb153 HBASE-26707: Reduce number of renames during bulkload (#4066) #4122) commit a4b192e HBASE-26611 Changing SFT implementation on disabled table is dangerous #4082) commit d3629bb HBASE-26837 Set SFT config when creating TableDescriptor in TestClone… #4226) commit 541d748 HBASE-26881 Backport HBASE-25368 to branch-2 (#4267) Fixups for precommit error prone, checkstyle, and javadoc warnings after applying cherry picks. Signed-off-by: Josh Elser <elserj@apache.org> Reviewed-by: Wellington Ramos Chevreuil <wchevreuil@apache.org>
…iptor when creating table (apache#3666) Signed-off-by: Duo Zhang <zhangduo@apache.org> Change-Id: I42be2a44ce7a365219d12bb2926c8d7f28f81097
No description provided.