Snapchat / KeyDB

A Multithreaded Fork of Redis
https://keydb.dev
BSD 3-Clause "New" or "Revised" License
11.02k stars 564 forks source link

[BUG] Replication incomplete when disk space is low #816

Open keithchew opened 3 months ago

keithchew commented 3 months ago

Testing on v6.3.4 (with flash), but this bug should be present in previous versions as well.

Steps:

On my local I have added an abort flag:

        bool fContinue = fn(it->key().data()+HASHSLOT_PREFIX_BYTES, it->key().size()-HASHSLOT_PREFIX_BYTES, it->value().data(), it->value().size());
        if (!fContinue) {
            aborted = true;
            break;
        }
...
    if (aborted) {
        printf("WARNING: rocksdb enumerate signaled to abort, m_count [%lu] count [%lu]\n", m_count, count);
        return false;
    }

This has fixed the issue, logs below:

7:71:M 2 Apr 2024 19:51:43 WARNING: rocksdb enumerate signaled to abort, m_count [5069771] count [4822420]
7:71:M 2 Apr 2024 19:51:43 * rdbSaveRio Failed to save
7:71:M 2 Apr 2024 19:51:43 # Write error saving DB on disk: No space left on device