You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kudu.apache.org by "Todd Lipcon (JIRA)" <ji...@apache.org> on 2018/01/17 01:44:00 UTC
[jira] [Commented] (KUDU-2195) Enforce durability happened before
relationships on multiple disks
[ https://issues.apache.org/jira/browse/KUDU-2195?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16328129#comment-16328129 ]
Todd Lipcon commented on KUDU-2195:
-----------------------------------
Looking at some issues on a host with XFS that has been experiencing power outages, I think we should probably add an fsync to the "atomic replace file" code path if we detect that the filesystem is XFS. Right now we end up with either 0-length files or files filled with 0 bytes, neither of which is recoverable.
It'll be a small perf hit but we're already paying that perf hit on ext4 so I think it's manageable, and it'll avoid these corruptions which are pretty bad.
As David points out this doesn't solve issue 2, but he also pointed out that issue 2 is a bit rarer
> Enforce durability happened before relationships on multiple disks
> ------------------------------------------------------------------
>
> Key: KUDU-2195
> URL: https://issues.apache.org/jira/browse/KUDU-2195
> Project: Kudu
> Issue Type: Bug
> Components: consensus, tablet
> Reporter: David Alves
> Priority: Major
>
> When using weaker durability semantics (e.g. when log_force_fsync is off) we should still enforce certain happened before relationships which are not currently being enforced when using different disks for the wal and data.
> The two cases that come to mind where this is relevant are:
> 1) cmeta (c) -> wal (w) : We flush cmeta before flushing the wal (for instance on term change) with the intention that either {}, \{c} or \{c, w} were made durable.
> 2) wal (w) -> tablet meta (t): We flush the wal before tablet metadata to make sure that that all commit messages that refer to on disk row sets (and deltas) are on disk before the row sets they point to, i.e. with the intention that either {}, \{w} or \{w, t} were made durable.
> With strong durability semantics these are always made durable in the right order. With weaker semantics that is not the case though. If using the same disk for both the wal and data then the invariants are still preserved, as buffers will be flushed in the right order but if using different disks for the wal and data (and because cmeta is stored with the data) that is not always the case.
> 1) in ext4 is actually safe, because we perform an fsync (indirect, rename() implies fsync in ext4) when flushing cmeta. But it is not for xfs.
> 2) Is not safe in either filesystem.
> --- Possible solutions --
> For 1): Store cmeta with the wal; actually always fsync cmeta.
> For 2): Store tablet meta with the wal; always fsync the wal before flushing tablet meta.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)