[SPDK] Rocksdb with SPDK

dimitra.giantsidi at gmail.com
Newsgroups dev.linux.lists.spdk
Message-ID <[email protected]>
Hi all, 

I am running Rocksdb on top of a blobfs filesystem and I have a couple of questions. 

1. What exactly does the ```sanitize_path()``` function do and why do we need to sanitize the path before opening a file? If the fname is /mnt/rocksdb/log, the sanitize path returns /log .. What does that means for my application?
2. the file->Sync() operations fails with a message "Not Implemented". In particular, I am having the following code :

```
if (!FLAGS__spdk.empty()) {
                        FLAGS_env = rocksdb::NewSpdkEnv(FLAGS_env, FLAGS_dir, FLAGS__spdk, FLAGS__spdk_bdev, FLAGS__spdk_cache_size);
                        fprintf(stdout, "Using rocksdb::NewSpdkEnv() environment.\n");
                        if (FLAGS_env == nullptr) {
                                fprintf(stderr, "Could not load SPDK blobfs - check that SPDK mkfs was run "
                                                "against block device %s.\n", FLAGS__spdk_bdev.c_str());
                                exit(1);
                        } 
                }

                unique_ptr<WritableFile> file;
                EnvOptions soptions;

                rocksdb::Slice data = return_data(FLAGS__value_size);
                Status s = FLAGS_env->NewWritableFile(FLAGS_file, &file, soptions);
                if (!s.ok()) {
                        fprintf(stderr, "oops ..\n");
                        abort();
                }

                size_t size = 0;
                size_t total_size = FLAGS_total_size*1024;
                struct timeval start_time, end_time;
                gettimeofday(&start_time, NULL);
                while (size < total_size) {
                        s = file->Append(data);

                        if (s.ok()) {
                                s = file->Sync();
                        }

                        size += FLAGS__value_size;

                        if (!s.ok()) {
                                fprintf(stdout, "written %d bytes to %s (%s)..\n", size, FLAGS_file.c_str(), s.ToString().c_str());
                                abort();
                        }
                }
```

However, I am seeing that the rocksdb::SpdkWritableFile::Sync() is implemented ..
Any ideas?
Thanks for your help :)

Dimitra
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.