# QDB namespace conversion process

**URL:** <https://eos-community.web.cern.ch/t/qdb-namespace-conversion-process/150>\
**Category:** Development\
**Created:** [May 28, 2018, 12:31am UTC](https://eos-community.web.cern.ch/t/qdb-namespace-conversion-process/150 "2018-05-28T00:31:43Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![crystal](https://eos-community.web.cern.ch/user_avatar/eos-community.web.cern.ch/crystal/32/23_2.png) [@crystal](https://eos-community.web.cern.ch/u/crystal)\
**Post date:** [May 28, 2018, 12:31am UTC](https://eos-community.web.cern.ch/t/qdb-namespace-conversion-process/150/1 "2018-05-28T00:31:43Z")

</div>

hi,

I’m trying to figure out the conversion process to qdb, would appreciate a quick rundown on how it’s supposed to work.

I ran eos\_ns\_convert on a node in “bulkload” mode using our production metadata, this finished in 340077s (~ 4 days, not sure if this is expected)

That process created the state machine but not the raft-journal, so when I switched it to raft mode and restarted, it kept crashing and complaining about not being able to find the raft journal, to fix this (maybe??) I ran quarkdb-journal --create manually.

It booted fine after that, so I added two other (empty) nodes to the cluster, but then it decided one of the empty nodes should be leader, so I guess it didn’t pick up on the stuff I spent four days loading 😭 maybe I missed a step somewhere?

I’m fine with running up a completely new/ empty cluster, but I can’t find much info on converting an existing namespace other than some hints from Georgios and Herve (ty!) There seems to be some pickiness on what folders can or can’t exist in each mode as well, it’d be nice to have more info on that.

thanks!

---

<div class="post-metadata">

**Author:** ![gbitzes](https://eos-community.web.cern.ch/letter_avatar_proxy/v4/letter/g/58f4c7/32.png) [@gbitzes](https://eos-community.web.cern.ch/u/gbitzes)\
**Post date:** [May 28, 2018, 8:12am UTC](https://eos-community.web.cern.ch/t/qdb-namespace-conversion-process/150/2 "2018-05-28T08:12:37Z")

</div>

Hi Crystal,

Indeed, the transition from bulkload to raft mode needs more polishing. 🙂 These are the steps for now, I’ll add a command to automate some of this:

- After bulkload is done, shut down the instance and create _a brand new_ QDB folder using quarkdb-create in a different location, using the nodes you’d like to have in the cluster.
- Steal its raft-journal, and move it to the QDB directory of the bulkloaded instance. You can just delete the newly created QDB created directory then.
- Manually copy the QDB directory with the data to all nodes you want to have in the cluster.
- Make sure the configuration is now in mode “raft”, not “bulkload” for all nodes, and start them all up.

I’m more worried that it took four days… We calculated that even for our largest instances, it shouldn’t take more than a couple of hours. A few questions:

- How many files and directories?
- What write rates was QDB reporting during bulkload?
- Which QDB version?
- How capable is the machine on which you’re running QDB? (cores, RAM) Are you running the tool and QDB on the same machine?
- How much time is actually spent writing into QDB, and how much time does it spend compacting?
- And most importantly: Are you using an SSD? From our tests running the new namespace in a pre-production instance, we found out that an SSD is pretty much mandatory, otherwise performance will become _very_ poor as soon as the total namespace size exceeds the physical RAM available on the machine.

---

<div class="post-metadata">

**Author:** ![gbitzes](https://eos-community.web.cern.ch/letter_avatar_proxy/v4/letter/g/58f4c7/32.png) [@gbitzes](https://eos-community.web.cern.ch/u/gbitzes)\
**Post date:** [May 28, 2018, 8:19am UTC](https://eos-community.web.cern.ch/t/qdb-namespace-conversion-process/150/3 "2018-05-28T08:19:54Z")

</div>

Also: What was the resulting size of the bulkloaded state machine?

Cheers,  
Georgios

---

<div class="post-metadata">

**Author:** ![crystal](https://eos-community.web.cern.ch/user_avatar/eos-community.web.cern.ch/crystal/32/23_2.png) [@crystal](https://eos-community.web.cern.ch/u/crystal)\
**Post date:** [May 28, 2018, 6:36pm UTC](https://eos-community.web.cern.ch/t/qdb-namespace-conversion-process/150/4 "2018-05-28T18:36:36Z")

</div>

aha okay so you actually do have to re-create the node entirely, and just move the raft-journal, noted!

Other answers:

- ~100 million files, ~20 million directories
- write rate started at about ~1000Hz, went up to 2000+Hz, just checked and it’s slowed way down to ~500HZ
  - it’s currently at about 2 million out of 3 million files processed, on each thread.
  - seems faster than the last attempt on the same machine, somehow, I started this ~18h ago, around when I wrote the first post in this thread

- qdb version 0.2.3
- Intel® Xeon® CPU E5-2620 v4 (8 cores ?), ~64GB ram, both are running on the same machine
  - memory use is ~91% by eos\_ns\_convert

- I’m not entirely sure since it ran over 4 days, I didn’t keep track, but these are the last lines it printed out on the last try
  - Container init: 20066022 containers in 33464 seconds
  - QuarkDB bulkload finalization: 4865 seconds
  - Conversion duration: 340077

- im guessing this is PROBABLY the issue … if so, that’s an easy enough fix ! I’ll try it out on another server and report back!
- will also get back to you on that last question, since i’m reloading the metadata now

---

<div class="post-metadata">

**Author:** ![gbitzes](https://eos-community.web.cern.ch/letter_avatar_proxy/v4/letter/g/58f4c7/32.png) [@gbitzes](https://eos-community.web.cern.ch/u/gbitzes)\
**Post date:** [May 28, 2018, 7:25pm UTC](https://eos-community.web.cern.ch/t/qdb-namespace-conversion-process/150/5 "2018-05-28T19:25:52Z")

</div>

Hi Crystal,

Indeed, 1 kHz is tragically low, I just tested on my laptop with the latest version and getting 185 kHz. Even in raft mode I’ve seen up to 100 kHz.

If you’re feeling brave, you could check the rocksdb logs in state-machine/LOG, look for “stalling”, “rate limiting”, or anything that indicates the write rate limiter has kicked in.

Another thing to try would be to run the tool against a full QDB cluster in raft mode. No need to wait for it to finish, the write rate within the first couple of minutes should be indicative enough.

Cheers,  
Georgios

---

<div class="post-metadata">

**Author:** ![gbitzes](https://eos-community.web.cern.ch/letter_avatar_proxy/v4/letter/g/58f4c7/32.png) [@gbitzes](https://eos-community.web.cern.ch/u/gbitzes)\
**Post date:** [May 28, 2018, 7:42pm UTC](https://eos-community.web.cern.ch/t/qdb-namespace-conversion-process/150/6 "2018-05-28T19:42:36Z")

</div>

One more thing to try: Run “redis-benchmark -p $qdb\_port -t set -P 10000 -n 10000000 -c 1 -r 10000000” against a throwaway bulkload QDB node (preferably same machine where you saw 1kHz), what rates do you see? It’s OK if you’d prefer to let the current conversion finish, I can wait. 🙂

Cheers,  
Georgios

---

<div class="post-metadata">

**Author:** ![gbitzes](https://eos-community.web.cern.ch/letter_avatar_proxy/v4/letter/g/58f4c7/32.png) [@gbitzes](https://eos-community.web.cern.ch/u/gbitzes)\
**Post date:** [May 28, 2018, 7:50pm UTC](https://eos-community.web.cern.ch/t/qdb-namespace-conversion-process/150/7 "2018-05-28T19:50:47Z")

</div>

Yet another thing to try: Run

`quarkdb-bench --gtest_filter="Benchmark/hset.hset/threads2_events3000000_consensus"`

The tool will spin up its own, private QDB cluster on localhost (ports 23456, 23457, 23458, path `/tmp/quarkdb-tests`) and hammer it with writes.

You may also get some useful information from `iotop`, while some benchmark is running.

Cheers,  
Georgios

---

<div class="post-metadata">

**Author:** ![crystal](https://eos-community.web.cern.ch/user_avatar/eos-community.web.cern.ch/crystal/32/23_2.png) [@crystal](https://eos-community.web.cern.ch/u/crystal)\
**Post date:** [May 29, 2018, 7:12am UTC](https://eos-community.web.cern.ch/t/qdb-namespace-conversion-process/150/8 "2018-05-29T07:12:14Z")

</div>

update: quite happily, i tried eos\_ns\_convert on a (previously) production mgm machine (~128GB ram, SSD), and i’m seeing ~150-165kHz, which is pretty great in comparison to the dev server I was using before 😛

```auto
Processed files at 143966 Hz
File init: 900 seconds
Commit quota and file system view ...
Quota view successfully commited
Quota init: 0 seconds
--
Container init: 20066022 containers in 115 seconds
QuarkDB bulkload finalization: 1207 seconds
Conversion duration: 2438

```

#### rocksdb log

nothing too interesting i can see, there’s this with “stall” in it:

```auto
**DB Stats**
Uptime(secs): 86264.9 total, 1219.0 interval
Cumulative writes: 57M writes, 71M keys, 55M commit groups, 1.0 writes per commit group, ingest: 10.93 GB, 0.13 MB/s
Cumulative WAL: 3 writes, 0 syncs, 3.00 writes per sync, written: 0.00 GB, 0.00 MB/s
Cumulative stall: 00:00:0.000 H:M:S, 0.0 percent
Interval writes: 362K writes, 400K keys, 354K commit groups, 1.0 writes per commit group, ingest: 63.36 MB, 0.05 MB/s
Interval WAL: 0 writes, 0 syncs, 0.00 writes per sync, written: 0.00 MB, 0.00 MB/s
Interval stall: 00:00:0.000 H:M:S, 0.0 percent

```

no mention of rate-limiting anywhere.

I was going to run redis-benchmark and quarkdb-bench on both the prod and dev servers and post the results in one go, after the dev server is done … (2 more days? 🤣 )

Since the prod server takes a much more reasonable amount of time to do the conversion, I think we’ll be fine - but I can update with the results of the benchmarking if needed 🙂

---

<div class="post-metadata">

**Author:** ![gbitzes](https://eos-community.web.cern.ch/letter_avatar_proxy/v4/letter/g/58f4c7/32.png) [@gbitzes](https://eos-community.web.cern.ch/u/gbitzes)\
**Post date:** [May 29, 2018, 8:08am UTC](https://eos-community.web.cern.ch/t/qdb-namespace-conversion-process/150/9 "2018-05-29T08:08:14Z")

</div>

Good to hear that. 🙂 150 kHz is much more like the rates we’ve seen with the tool, as well.

Still, I cannot explain why you’re getting 1 kHz on the dev server… Even on an ancient desktop CPU with HDD I’ve seen better. 😛

Which RPM version provides eos\_ns\_convert you’re using? (`rpm -qa | grep eos`) Some old versions (5+ months) were slow, doing synchronous requests to QDB.

Maybe prod server has a newer version, and dev an older one?

Cheers,  
Georgios

---

<div class="post-metadata">

**Author:** ![crystal](https://eos-community.web.cern.ch/user_avatar/eos-community.web.cern.ch/crystal/32/23_2.png) [@crystal](https://eos-community.web.cern.ch/u/crystal)\
**Post date:** [May 29, 2018, 8:51am UTC](https://eos-community.web.cern.ch/t/qdb-namespace-conversion-process/150/10 "2018-05-29T08:51:57Z")

</div>

nope, they’re using the same docker container - so all versions should be the same (eos-server version is 4.2.22).

it’s slowed down now to 1-250Hz 🙄 I’ll probably just stop this conversion and retry tomorrow writing to ssd instead, see if that helps much, although its maybe a memory problem ?

I actually tried running eos\_ns\_convert on a different (much smaller) set of .mdlog files, but it kept crashing on “Container #0 not found” before it even got to processing entries. If you happen to know how to fix that, I’ll see if I can use that instead to test, at the least it shouldn’t take 4 days 😛

---

<div class="post-metadata">

**Author:** ![gbitzes](https://eos-community.web.cern.ch/letter_avatar_proxy/v4/letter/g/58f4c7/32.png) [@gbitzes](https://eos-community.web.cern.ch/u/gbitzes)\
**Post date:** [May 29, 2018, 9:05am UTC](https://eos-community.web.cern.ch/t/qdb-namespace-conversion-process/150/11 "2018-05-29T09:05:40Z")

</div>

Yeah, if the machine has started swapping due to low memory, that could explain the rate…

About the crash: Hm, that sounds like a bug in the conversion tool, thanks for mentioning, I’ll take a look.

Cheers,  
Georgios

---

<div class="post-metadata">

**Author:** ![gbitzes](https://eos-community.web.cern.ch/letter_avatar_proxy/v4/letter/g/58f4c7/32.png) [@gbitzes](https://eos-community.web.cern.ch/u/gbitzes)\
**Post date:** [May 30, 2018, 12:51pm UTC](https://eos-community.web.cern.ch/t/qdb-namespace-conversion-process/150/12 "2018-05-30T12:51:47Z")

</div>

Hi Crystal,

Elvin tells me the namespace has to be compacted right before running the conversion tool, this is likely the reason behind “Container #0 not found.”

Cheers,  
Georgios

---

<div class="post-metadata">

**Author:** ![crystal](https://eos-community.web.cern.ch/user_avatar/eos-community.web.cern.ch/crystal/32/23_2.png) [@crystal](https://eos-community.web.cern.ch/u/crystal)\
**Post date:** [June 3, 2018, 10:41pm UTC](https://eos-community.web.cern.ch/t/qdb-namespace-conversion-process/150/13 "2018-06-03T22:41:27Z")

</div>

sorry for delay!

i ran eos-log-compact on the file and directory metadata for that instance and it completed okay, still getting the container not found issue:

```auto
terminate called after throwing an instance of 'eos::MDException'
  what(): Container #0 not found

```

it may well be an issue on our end (with the metadata), but i’ve got a coredump if you’re interested in checking that out?

---

<div class="post-metadata">

**Author:** ![gbitzes](https://eos-community.web.cern.ch/letter_avatar_proxy/v4/letter/g/58f4c7/32.png) [@gbitzes](https://eos-community.web.cern.ch/u/gbitzes)\
**Post date:** [June 4, 2018, 8:05am UTC](https://eos-community.web.cern.ch/t/qdb-namespace-conversion-process/150/14 "2018-06-04T08:05:42Z")

</div>

Hi Crystal,

If the coredump is not too big, sure, feel free to email it to me. Otherwise, a stacktrace should do fine for now.

Cheers,  
Georgios

---

<div class="post-metadata">

**Author:** ![esindril](https://eos-community.web.cern.ch/user_avatar/eos-community.web.cern.ch/esindril/32/9_2.png) [@esindril](https://eos-community.web.cern.ch/u/esindril)\
**Post date:** [July 25, 2018, 1:35pm UTC](https://eos-community.web.cern.ch/t/qdb-namespace-conversion-process/150/15 "2018-07-25T13:35:21Z")

</div>

Hi Crystal,

The issue with the exception being thrown during conversion will be fixed in the EOS 4.3.5 release.  
Thanks for reporting it.

Cheers,  
Elvin
