hbase/hbase-protocol
Bharath Vissapragada 5ece9cefea
HBASE-26070: Rewrite 1.7.0 faulty table descriptors at bootstrap (#3463)
This patch rewrites incorrectly serialized table descriptors and states
from HBASE-26021 into PBs prior to the incompatible change. The patch
does this as a part of the active HMaster bootstrap.

This approach is _not_ fool proof as it does not handle all the edge cases
and may break certain rolling upgrade semantics. However it does provide a way
out for tables created with 1.7.0 PB definitions and an upgrade path for 1.7.1.
Easiest way is to shutdown the 1.7.0 cluster, reboot with 1.7.1 binaries and
everything should work cleanly. However, rolling upgrade could potentially be
broken as 1.7.0 client may not be compatible with 1.7.1 server.

As noted in the jira, it is not possible that any one upgraded to 1.7.0 yet
because they will run into HBASE-26021, however new clusters may have been
created with 1.7.0 and hence they need an upgrade path.

Tested locally:

- Created a mix of enabled/disabled tables created with 1.7.0
- Upgraded the cluster without this patch, noticed deserialization errors
- Upgraded the cluster with patch and table metadata has been re-serialized
  in correct format and table states are preserved.

Signed-off-by: Reid Chan <reidchan@apache.org>
2021-07-07 21:19:31 -07:00
..

These are the protobuf definition files used by hbase. The produced java
classes are generated into src/main/java/org/apache/hadoop/hbase/protobuf/generated
and then checked in.  The reasoning is that they change infrequently.

To regenerate the classes after making definition file changes, ensure first that
the protobuf protoc tool is in your $PATH (You may need to download it and build
it first; its part of the protobuf package obtainable from here: 
https://github.com/google/protobuf/releases/tag/v2.5.0).

HBase uses hadoop-maven-plugins:protoc goal to invoke the protoc command. You can 
compile the protoc definitions by invoking maven with profile compile-protobuf or 
passing in compile-protobuf property. 

mvn compile -Dcompile-protobuf
or
mvn compile -Pcompile-protobuf

You may also want to define protoc.path for the protoc binary

mvn compile -Dcompile-protobuf -Dprotoc.path=/opt/local/bin/protoc

If you have added a new proto file, you should add it to the pom.xml file first.
Other modules also support the maven profile.

After you've done the above, check it in and then check it in (or post a patch
on a JIRA with your definition file changes and the generated files).