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

dbpath instead of dbname #1540

Merged
merged 1 commit into from
May 25, 2023

Conversation

Brokenice0415
Copy link
Contributor

use dbpaths[0].path to replace dbname for that dbname may be repeated and may not be the same with real directory path

@wanghenshui
Copy link
Collaborator

这种代码怎么做单测呢,怎么提前发现代码写的不对

@Brokenice0415
Copy link
Contributor Author

这个是为了适应rocksdb较新版本的设置,也就是实际存储路径以dbpath为准,在当前的pika的db创建逻辑里本次修改前后是等同的。

pika里直接把pika用的db_path传入给rocksdb的dbname (i.e. storage/src/reds_strings.cc:37),然后用他设置的默认dbpath[0]=dbname (rocksdb/db/db_impl/db_impl_open.cc:121)取得真实存储路径。

如果要单测的话目前只能对rocksdb本身测试,就是指定dbpath != dbname 的情况看wal_dir的值或者看wal是否会丢失。

或者修改pika的db创建逻辑以适应rocksdb的这一设置,然后再整体在pika进行对应单测。但我还不是很清楚pika中是否有必要引入这个设置。

@AlexStocks AlexStocks merged commit 7a739c8 into OpenAtomFoundation:unstable May 25, 2023
bigdaronlee163 pushed a commit to bigdaronlee163/pika that referenced this pull request Jun 8, 2024
cheniujh pushed a commit to cheniujh/pika that referenced this pull request Sep 24, 2024
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.

4 participants