You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2021/05/07 00:45:35 UTC

[GitHub] [bookkeeper] rdhabalia opened a new pull request #2708: BookKeeper-Client config to write ledger metadata with configured version

rdhabalia opened a new pull request #2708:
URL: https://github.com/apache/bookkeeper/pull/2708


   ### Motivation
   
   We need a way to use old bookie which doesn't support metadata-version-3 and upgrade bookkeeper-client with latest version. Right now, bk-4.12 writes ledger metadata with version-3 which will not be supported by bookie and replicator and replicator fails with below error
   ```
   2021-05-07.00:43:53.115 [main-EventThread] ERROR
                   o.a.b.meta.AbstractZkLedgerManager   - Could not parse ledger metadata for ledger: 123456
   java.io.IOException: Metadata version not compatible. Expected between 0 and 2, but got 3
           at org.apache.bookkeeper.client.LedgerMetadata.parseConfig(LedgerMetadata.java:465)
           at org.apache.bookkeeper.meta.AbstractZkLedgerManager$3.processResult(AbstractZkLedgerManager.java:414)
           at org.apache.bookkeeper.zookeeper.ZooKeeperClient$19$1.processResult(ZooKeeperClient.java:994)
           at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:572)
           at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:508)
   
   ```
   So, until one upgrades the bookie version, allow bk-client to use the appropriate metadata version.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [bookkeeper] sijie merged pull request #2708: BookKeeper-Client config to write ledger metadata with configured version

Posted by GitBox <gi...@apache.org>.
sijie merged pull request #2708:
URL: https://github.com/apache/bookkeeper/pull/2708


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [bookkeeper] merlimat commented on a change in pull request #2708: BookKeeper-Client config to write ledger metadata with configured version

Posted by GitBox <gi...@apache.org>.
merlimat commented on a change in pull request #2708:
URL: https://github.com/apache/bookkeeper/pull/2708#discussion_r627861608



##########
File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/conf/AbstractConfiguration.java
##########
@@ -440,6 +441,25 @@ public String getLedgerManagerFactoryClassName() {
         return getString(LEDGER_MANAGER_FACTORY_CLASS);
     }
 
+    /**
+     * Set Ledger metadata format version.
+     *
+     * @param metadataFormatVersion
+     *          Ledger metadata format version. pass -1 to use default version
+     */
+    public void SetLedgerMetadataFormatVersion(int metadataFormatVersion) {

Review comment:
       ```suggestion
       public void setLedgerMetadataFormatVersion(int metadataFormatVersion) {
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [bookkeeper] merlimat commented on a change in pull request #2708: BookKeeper-Client config to write ledger metadata with configured version

Posted by GitBox <gi...@apache.org>.
merlimat commented on a change in pull request #2708:
URL: https://github.com/apache/bookkeeper/pull/2708#discussion_r627875409



##########
File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerMetadataBuilder.java
##########
@@ -108,6 +109,9 @@ public LedgerMetadataBuilder withId(long ledgerId) {
     }
 
     public LedgerMetadataBuilder withMetadataFormatVersion(int version) {
+		if (version < METADATA_FORMAT_VERSION_1 && version > CURRENT_METADATA_FORMAT_VERSION) {

Review comment:
       indenting seems to be in tab and not spaces (also above)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org