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

Problem: Background compaction IO error - too many files open causes puts to block forever #818

Open
trevorbernard opened this issue Sep 14, 2023 · 0 comments

Comments

@trevorbernard
Copy link

trevorbernard commented Sep 14, 2023

If the background compaction errors, it silently causes the writes to hang forever. I would expect an error to be thrown.

    pub fn put_cf_opt<K, V>(
        &self,
        cf: &impl AsColumnFamilyRef,
        key: K,
        value: V,
        writeopts: &WriteOptions,
    ) -> Result<(), Error>
    where
        K: AsRef<[u8]>,
        V: AsRef<[u8]>,
    {
        let key = key.as_ref();
        let value = value.as_ref();

        unsafe {
            ffi_try!(ffi::rocksdb_put_cf(
                self.inner.inner(),
                writeopts.inner,
                cf.inner(),
                key.as_ptr() as *const c_char,
                key.len() as size_t,
                value.as_ptr() as *const c_char,
                value.len() as size_t,
            ));
            Ok(())
        }
    }

Setting the the no slowdown write option to true doesn't stop it from blocking

let mut writeopts = WriteOptions::default();
writeopts.set_no_slowdown(true);
self.db.put_cf_opt(&cf_handle, key, value, &writeopts)?;
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

No branches or pull requests

1 participant