[ 
https://issues.apache.org/jira/browse/HBASE-26690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17480428#comment-17480428
 ] 

Duo Zhang commented on HBASE-26690:
-----------------------------------

Ah, there is a nasty problem... The protobuf message can be decoded with 
partial bytes written...

https://github.com/Apache9/hbase/commit/4761ea76cc94e09d8d182a2c65cd4af7c4662b1a

Please see this commit, I added a test called 
testIgnoreBrokenTableDescriptorFiles, where I tried to write all possible 
partial result for a TableDescriptor and then try to load it.

First I found out that a zero length pb can be decoded by then we will face a 
IllegalArgumentException because the TableName field is not present. And I 
tried to fix this case by checking the minimum length, but the UT could still 
fail because the loading of the partial bytes can pass for some cases...

So we need to find other ways to deal with this ways, for example, add a 
trailer or something so we know whether the file is complete...

This means the implementation for StoreFileListFile is also not stable enough, 
we also need to apply the same trick to it...

Let me think how to better deal with it...

[~elserj] [~wchevreuil] FYI.

> Modify FSTableDescriptors to not rely on renaming when writing TableDescriptor
> ------------------------------------------------------------------------------
>
>                 Key: HBASE-26690
>                 URL: https://issues.apache.org/jira/browse/HBASE-26690
>             Project: HBase
>          Issue Type: Sub-task
>          Components: master
>            Reporter: Duo Zhang
>            Assignee: Duo Zhang
>            Priority: Major
>




--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to