Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix miscreating column families when opening with the readonly mode #1645

Merged
merged 3 commits into from
Aug 7, 2023

Conversation

git-hulk
Copy link
Member

@git-hulk git-hulk commented Aug 6, 2023

Currently, kvrocks2redis will read and parse data from the local DB
with opening in read-only mode, and it will be failed if the Kvrocks
is running on the same DB dir.

The root cause is the running Kvrocks would acquire the DB lock and
kvrocks2redis would try to acquire this DB lock as well when creating
column families.

Before applying this patch:

❯ ./kvrocks2redis -c kvrocks2redis.conf
Version: unstable @6350d72
E20230806 23:46:56.435000 18548092 main.cc:151] Failed to create pidfile './kvrocks2redis.pid': File exists

After applying this patch:

❯ ./kvrocks2redis -c kvrocks2redis.conf
Version: unstable @6350d72
Start parse increment batch ...

This fixes #1644.

…only mode

Currently, kvrocks2redis will read and parse data from local DB with
openning in readonly mode, and it will be failed if the Kvrocks is
running on the same DB dir. The root cause is the running Kvrocks would
acquire the DB lock and kvrocks2redis would try to acquire this DB
lock as well when creating column familes.
@PragmaTwice PragmaTwice changed the title Fix shouldn't try to create column families when opening with the readonly mode Fix miscreating column families when opening with the readonly mode Aug 7, 2023
@PragmaTwice PragmaTwice merged commit 20b49b4 into apache:unstable Aug 7, 2023
26 checks passed
p1u3o pushed a commit to p1u3o/incubator-kvrocks that referenced this pull request Aug 15, 2023
…pache#1645)

Currently, kvrocks2redis will read and parse data from the local DB
with opening in read-only mode, and it will be failed if the Kvrocks
is running on the same DB dir.

The root cause is the running Kvrocks would acquire the DB lock and
kvrocks2redis would try to acquire this DB lock as well when creating
column families.

Before applying this patch:
```shell
❯ ./kvrocks2redis -c kvrocks2redis.conf
Version: unstable @6350d72
E20230806 23:46:56.435000 18548092 main.cc:151] Failed to create pidfile './kvrocks2redis.pid': File exists
```

After applying this patch:
```shell
❯ ./kvrocks2redis -c kvrocks2redis.conf
Version: unstable @6350d72
Start parse increment batch ...
```

This fixes apache#1644.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failed to open Kvrocks storage when running the kvrocks2redis
4 participants