bdb convert problem when 0.95 moving to 1.6.0

128 views
Skip to first unread message

jam+

unread,
Mar 10, 2014, 11:12:40 PM3/10/14
to project-...@googlegroups.com
Hi,

I am trying to upgrade my old 0.95 to 1.6.0, but yesterday I got bdb convert trouble...

Here is my command:
time /opt/vdm-1.6.0/bin/voldemort-convert-bdb.sh --cluster-xml /opt/vdm-0.95/conf/config/cluster.xml --store Account_Store --src /mnt/data/bdb/origin/ --dest /mnt/data/bdb/converted/  --from-format Base --to-format PidScan

real    587m54.421s
user    661m2.055s
sys     9m30.732s

After almost 10 hours (total bdb size is 75G) the process is done, but the unbelievable result is there is nothing in /mnt/data/bdb/converted/ (an empty folder) ... ><
Before I ran the script I had used je-4.1.17.jar to "preUpgrade" bdb files already. Here is my command:

java -jar /mnt/bdb_tools/je-4.1.17.jar DbPreUpgrade_4_1 -h  /mnt/data/bdb/origin/


Can someone give me some hints ? Is there any problem in my process ? 

Thanks.

Vinoth C

unread,
Mar 11, 2014, 1:55:44 PM3/11/14
to project-...@googlegroups.com
So you preupgraded to 5.x and then used the conversion tool?

Though it should theoretically work, what we did was to

-- Convert to PidScan format first (still 4.1.17)
-- Then move to BDB 5..

There are some quirks around opening the old format in BDB5.. and may not even work if you had multiple versions for a lot of keys..

jam+

unread,
Mar 11, 2014, 11:53:58 PM3/11/14
to project-...@googlegroups.com
Thank you Vinoth.

But if I skip DbPreUpgrade and convert bdb directly, I will got the error as follow:

[03:33:08,873 voldemort.store.bdb.dataconversion.BdbConvertData] ERROR Error converting data  [main]
com.sleepycat.je.EnvironmentFailureException: (JE 5.0.88) JE 4.1 duplicate DB entries were found in the recovery interval. Before upgrading to JE 5.0, the following utility must be run using JE 4.1 (4.1.20 or later): DbPreUpgrade_4_1 . See the change log. UNEXPECTED_STATE: Unexpected internal state, may have side effects.
        at com.sleepycat.je.EnvironmentFailureException.unexpectedState(EnvironmentFailureException.java:376)
        at com.sleepycat.je.recovery.RecoveryManager.checkLogVersion8UpgradeViolations(RecoveryManager.java:2851)
        at com.sleepycat.je.recovery.RecoveryManager.buildTree(RecoveryManager.java:688)
        at com.sleepycat.je.recovery.RecoveryManager.recover(RecoveryManager.java:337)
        at com.sleepycat.je.dbi.EnvironmentImpl.finishInit(EnvironmentImpl.java:655)
        at com.sleepycat.je.dbi.DbEnvPool.getEnvironment(DbEnvPool.java:208)
        at com.sleepycat.je.Environment.makeEnvironmentImpl(Environment.java:252)
        at com.sleepycat.je.Environment.<init>(Environment.java:233)
        at com.sleepycat.je.Environment.<init>(Environment.java:177)
        at voldemort.store.bdb.dataconversion.AbstractBdbConversion.<init>(AbstractBdbConversion.java:53)
        at voldemort.store.bdb.dataconversion.BdbConvertBaseToPidScan.<init>(BdbConvertBaseToPidScan.java:25)
        at voldemort.store.bdb.dataconversion.BdbConvertData.main(BdbConvertData.java:93)

p.s. My current vdm version is 0.95, maybe it is the older bdb version ?

Vinoth C於 2014年3月12日星期三UTC+8上午1時55分44秒寫道:

jam+

unread,
Mar 12, 2014, 10:32:18 PM3/12/14
to project-...@googlegroups.com
I am trying to convert another store first but still fail...
Is there another approach to upgrade and keep origin data ? 3rd party export tool or something...


[15:28:41,047 voldemort.store.bdb.dataconversion.BdbConvertData] ERROR Error converting data  [main]
com.sleepycat.je.EnvironmentFailureException: (JE 5.0.88) Cannot write file summary in a read-only environment UNEXPECTED_STATE: Unexpected internal state, may have side effects.
        at com.sleepycat.je.EnvironmentFailureException.unexpectedState(EnvironmentFailureException.java:376)
        at com.sleepycat.je.cleaner.UtilizationProfile.putFileSummary(UtilizationProfile.java:491)
        at com.sleepycat.je.cleaner.UtilizationProfile.flushFileSummary(UtilizationProfile.java:479)
        at com.sleepycat.je.cleaner.UtilizationProfile.flushFileUtilization(UtilizationProfile.java:199)
        at com.sleepycat.je.cleaner.UtilizationProfile.flushLocalTracker(UtilizationProfile.java:177)
        at com.sleepycat.je.tree.dupConvert.DupConvert.convertDatabase(DupConvert.java:254)
        at com.sleepycat.je.tree.dupConvert.DupConvert.convertDatabases(DupConvert.java:160)
        at com.sleepycat.je.dbi.EnvironmentImpl.convertDupDatabases(EnvironmentImpl.java:1868)
        at com.sleepycat.je.dbi.EnvironmentImpl.finishInit(EnvironmentImpl.java:736)
        at com.sleepycat.je.dbi.DbEnvPool.getEnvironment(DbEnvPool.java:208)
        at com.sleepycat.je.Environment.makeEnvironmentImpl(Environment.java:252)
        at com.sleepycat.je.Environment.<init>(Environment.java:233)
        at com.sleepycat.je.Environment.<init>(Environment.java:177)
        at voldemort.store.bdb.dataconversion.AbstractBdbConversion.<init>(AbstractBdbConversion.java:53)
        at voldemort.store.bdb.dataconversion.BdbConvertBaseToPidScan.<init>(BdbConvertBaseToPidScan.java:25)
        at voldemort.store.bdb.dataconversion.BdbConvertData.main(BdbConvertData.java:93)

jam+於 2014年3月12日星期三UTC+8上午11時53分58秒寫道:

Brendan Harris (a.k.a. stotch on irc.oftc.net)

unread,
Mar 13, 2014, 1:50:20 AM3/13/14
to project-...@googlegroups.com
Hi Jam,

There are two problems, here. In the first problem, you did not run DbPreUpgrade_4_1 against your bdb format stores before trying to start up the new version of voldemort. In the second problem you're trying to convert read-only format (non-bdb) stores. What you need to do is ...

For each server in your cluster
  Shutdown voldemort
  Install the new version of voldemort, but do not start it
  For each bdb store directory on your server
    Run the DbPreUpgrade_4_1 against that directory
  Start voldemort

Vinoth,

We might need to review and update the documentation to be clearer.

Brendan

jam+

unread,
Mar 18, 2014, 2:33:22 AM3/18/14
to project-...@googlegroups.com
Thanks Brendan.

So I don't need to run voldemort-convert-bdb.sh to convert bdb files ? 
    

Brendan Harris (a.k.a. stotch on irc.oftc.net)於 2014年3月13日星期四UTC+8下午1時50分20秒寫道:

Vinoth C

unread,
Mar 18, 2014, 6:51:43 PM3/18/14
to project-...@googlegroups.com
@brendan, yes.. Lets revisit the doc for sure..


jam ,
you still need to convert.. Brendan was just pointing out a painless way to move to bdb5 + PIDSCAN format in one go..

(One thing to keep in mind is that the conversion script will open your existing database with duplicates using BDB5. So, make sure you give as much memory [heap+ bdb cache] as possible for your case. I am not saying you will definitely have problems. But you might due to the way bdb5 handles duplicates.)

jam+

unread,
Mar 19, 2014, 12:01:38 AM3/19/14
to project-...@googlegroups.com
Thanks Vinoth.

I am just curious about if I start 1.6.0 then it would join my cluster (0.95) at the same time...
So are they compatible during bdb conversion ?

Another problem is how to deal with "read-only" conversion ?
All of my bdb files (24 stores) are stored in a same folder, and I can't figure out which is the read-only format or store it belongs to  ...

Lots thanks.
 

Vinoth C於 2014年3月19日星期三UTC+8上午6時51分43秒寫道:

Vinoth C

unread,
Mar 19, 2014, 12:24:20 PM3/19/14
to project-...@googlegroups.com
Inline

On Tuesday, March 18, 2014 9:01:38 PM UTC-7, jam+ wrote:
Thanks Vinoth.

I am just curious about if I start 1.6.0 then it would join my cluster (0.95) at the same time...
So are they compatible during bdb conversion ?

yes.. the data format change has no implications for the protocol on the wire.. So, should be good. 
Another problem is how to deal with "read-only" conversion ?
All of my bdb files (24 stores) are stored in a same folder, and I can't figure out which is the read-only format or store it belongs to  ...

read only is its own format and has nothing to do with bdb.. check your store's persistence type..
The data conversion only applies to bdb.

jam+

unread,
Mar 20, 2014, 7:21:54 AM3/20/14
to project-...@googlegroups.com
Thanks Vinoth.

Unfortunately it still didn't work and here is the error:
[10:50:26,046 voldemort.store.bdb.dataconversion.BdbConvertData] ERROR Error converting data  [main]
com.sleepycat.je.EnvironmentFailureException: (JE 5.0.88) Cannot write file summary in a read-only environment UNEXPECTED_STATE: Unexpected internal state, may have side effects.
at com.sleepycat.je.EnvironmentFailureException.unexpectedState(EnvironmentFailureException.java:376)
at com.sleepycat.je.cleaner.UtilizationProfile.putFileSummary(UtilizationProfile.java:491)
at com.sleepycat.je.cleaner.UtilizationProfile.flushFileSummary(UtilizationProfile.java:479)
at com.sleepycat.je.cleaner.UtilizationProfile.flushFileUtilization(UtilizationProfile.java:199)
at com.sleepycat.je.cleaner.UtilizationProfile.flushLocalTracker(UtilizationProfile.java:177)
at com.sleepycat.je.tree.dupConvert.DupConvert.convertDatabase(DupConvert.java:254)
at com.sleepycat.je.tree.dupConvert.DupConvert.convertDatabases(DupConvert.java:160)
at com.sleepycat.je.dbi.EnvironmentImpl.convertDupDatabases(EnvironmentImpl.java:1868)
at com.sleepycat.je.dbi.EnvironmentImpl.finishInit(EnvironmentImpl.java:736)
at com.sleepycat.je.dbi.DbEnvPool.getEnvironment(DbEnvPool.java:208)
at com.sleepycat.je.Environment.makeEnvironmentImpl(Environment.java:252)
at com.sleepycat.je.Environment.<init>(Environment.java:233)
at com.sleepycat.je.Environment.<init>(Environment.java:177)
at voldemort.store.bdb.dataconversion.AbstractBdbConversion.<init>(AbstractBdbConversion.java:53)
at voldemort.store.bdb.dataconversion.BdbConvertBaseToPidScan.<init>(BdbConvertBaseToPidScan.java:25)
at voldemort.store.bdb.dataconversion.BdbConvertData.main(BdbConvertData.java:93)

It's really weird that there is no "read-only" persistence in my store.xml and the folder I specified is my bdb files path...
Here is what I did step by step:

1. Shutdown voldemort-0.95

2. Install voldemort-1.6.0 (but did not start it)

3. ls my bdb folder
jam[1]1$ ls /mnt/vdm/accountservice/data/bdb/
00000022.jdb  00000023.jdb  00000024.jdb  je.info.0  je.info.0.1  je.lck

4. DbPreUpgrade_4_1 bdb
jam[1]1$ java -jar je-4.1.20.jar DbPreUpgrade_4_1 -h /mnt/vdm/accountservice/data/bdb/

5. Start voldemort-1.6.0
jam[1]1$ cd /mnt/voldemort-1.6.0
jam[1]1$ ./bin/voldemort-server.sh . ./config &

6. Run conversion script
jam[1]1$ ./bin/voldemort-convert-bdb.sh --cluster-xml ./config/cluster.xml --src /mnt/vdm/accountservice/data/bdb/ --dest /mnt/data/bdb/ --store Account_Store  --from-format Base --to-format PidScan
[10:49:58,018 voldemort.cluster.Node] WARN admin-port not defined for node:0 using default value(socket_port + 1):6667  [main]
[10:49:58,021 voldemort.cluster.Node] WARN admin-port not defined for node:1 using default value(socket_port + 1):6667  [main]
[10:49:58,021 voldemort.cluster.Node] WARN admin-port not defined for node:2 using default value(socket_port + 1):6667  [main]
[10:49:58,022 voldemort.cluster.Node] WARN admin-port not defined for node:3 using default value(socket_port + 1):6667  [main]
[10:50:02,453 voldemort.store.bdb.dataconversion.BdbConvertData] ERROR Error converting data  [main]
com.sleepycat.je.EnvironmentFailureException: (JE 5.0.88) Cannot write file summary in a read-only environment UNEXPECTED_STATE: Unexpected internal state, may have side effects.
at com.sleepycat.je.EnvironmentFailureException.unexpectedState(EnvironmentFailureException.java:376)
at com.sleepycat.je.cleaner.UtilizationProfile.putFileSummary(UtilizationProfile.java:491)
at com.sleepycat.je.cleaner.UtilizationProfile.flushFileSummary(UtilizationProfile.java:479)
at com.sleepycat.je.cleaner.UtilizationProfile.flushFileUtilization(UtilizationProfile.java:199)
at com.sleepycat.je.cleaner.UtilizationProfile.flushLocalTracker(UtilizationProfile.java:177)
at com.sleepycat.je.tree.dupConvert.DupConvert.convertDatabase(DupConvert.java:254)
at com.sleepycat.je.tree.dupConvert.DupConvert.convertDatabases(DupConvert.java:160)
at com.sleepycat.je.dbi.EnvironmentImpl.convertDupDatabases(EnvironmentImpl.java:1868)
at com.sleepycat.je.dbi.EnvironmentImpl.finishInit(EnvironmentImpl.java:736)
at com.sleepycat.je.dbi.DbEnvPool.getEnvironment(DbEnvPool.java:208)
at com.sleepycat.je.Environment.makeEnvironmentImpl(Environment.java:252)
at com.sleepycat.je.Environment.<init>(Environment.java:233)
at com.sleepycat.je.Environment.<init>(Environment.java:177)
at voldemort.store.bdb.dataconversion.AbstractBdbConversion.<init>(AbstractBdbConversion.java:53)
at voldemort.store.bdb.dataconversion.BdbConvertBaseToPidScan.<init>(BdbConvertBaseToPidScan.java:25)
at voldemort.store.bdb.dataconversion.BdbConvertData.main(BdbConvertData.java:93)

Here is the related information I found: http://goo.gl/dcMwzG but didn't help...

Thanks again.

Vinoth C於 2014年3月20日星期四UTC+8上午12時24分20秒寫道:

Vinoth C

unread,
Mar 21, 2014, 9:10:06 AM3/21/14
to project-...@googlegroups.com
So BDB has a read only mode, which is used by the data conversion script (to make sure nothing in the original data is changed by mistake). 


I think whats happening is that when BDB5 opens the pre upgraded DB, its wanting to do some bookkeeping to record the fact and its unable to since its a read only copy..
Try changing setReadOnly(true) -> setReadOnly(false) and see how it goes.. if it works. Please send a pull req with the change.. 

Thanks for working through this patiently. We went from 1.3 to 1.6 so never hit this. 

Vinoth C

unread,
Mar 21, 2014, 9:19:43 AM3/21/14
to project-...@googlegroups.com
Updated the README with a BDB5 section


Also review if that works for you and include any corrections in the pull request, if possible. 

jam+

unread,
Mar 25, 2014, 4:29:03 AM3/25/14
to project-...@googlegroups.com
This is really helpful!

Currently I am converting our test environment and so far so good ~

I will make a pull request after some data verifications.

Lots thanks, Vinoth.


Vinoth C於 2014年3月21日星期五UTC+8下午9時10分06秒寫道:
Reply all
Reply to author
Forward
0 new messages