Rocksdb: 2PC bug

Created on 1 Nov 2018  路  4Comments  路  Source: facebook/rocksdb

In 2PC transaction, after we write a prepare entry into WAL, we call a Flush before MarkLogAsContainingPrepSection, the log file containing the prepare entry will be deleted.
see https://github.com/facebook/rocksdb/pull/4612

All 4 comments

@maysamyabandeh could you take a look?

Thanks @cooljiansir Seems to be a valid issue. One solution could be marking the prepared logs in the write thread via PreReleaseCallback. (We can then remove logs_with_prep_mutex_ as it would be already protected by mutex_.) The drawback would be longer write time which could have negative impact in performance but I do not see any way around it.
@yiwu-arbug @lth what do you think?

That sounds reasonable to me, since we need some way of writing WAL and marking logs atomically.

We will have to extend the callback to include log_used though, so we just have to make sure that's available when we call the callback.

+1 for marking log atomically during write. I'm not familiar with the MarkLogAsContainingPrepSection though. Not sure if it will really have impact on write time.

Was this page helpful?
0 / 5 - 0 ratings