1 |
On Thu, Sep 1, 2016 at 2:09 PM, Volker Armin Hemmann |
2 |
<volkerarmin@××××××××××.com> wrote: |
3 |
> |
4 |
> a common misconception. But not true at all. Google a bit. |
5 |
|
6 |
Feel free to enlighten us. My understanding is that data=journal |
7 |
means that all data gets written first to the journal. Completed |
8 |
writes will make it to the main filesystem after a crash, and |
9 |
incomplete writes will of course be rolled back, which is what you |
10 |
want. |
11 |
|
12 |
But simply disagreeing and saying to search Google is fairly useless, |
13 |
since you can find all kinds of junk on Google. You can't even |
14 |
guarantee that the same search terms will lead to the same results for |
15 |
two different people. |
16 |
|
17 |
And FWIW, this is a topic that Linus and the ext3 authors have |
18 |
disagreed with at points (not this specific question, but rather what |
19 |
the most appropriate defaults are). So, it isn't like there isn't |
20 |
room for disagreement on best practice, or that any two people with |
21 |
knowledge of the issues are guaranteed to agree. |
22 |
|
23 |
>> |
24 |
>> Now, I can still think of ways you can lose data in data=journal mode: |
25 |
>> |
26 |
>> * You mounted the filesystem with barrier=0 or with nobarrier; this can result |
27 |
> |
28 |
> not needed. |
29 |
|
30 |
Well, duh. He is telling people NOT to do this, because this is how |
31 |
you can LOSE data. |
32 |
|
33 |
|
34 |
>> |
35 |
>> * Your application didn't flush its writes to disk when it should have. |
36 |
> |
37 |
> not needed either. |
38 |
|
39 |
That very much depends on the application. If you need to ensure that |
40 |
transactions are in-sync with remote hosts (such as in a database) it |
41 |
is absolutely critical to flush writes. |
42 |
|
43 |
Applications shouldn't just flush on every write or close, because |
44 |
that causes needless disk thrashing. Yes, data will be lost if users |
45 |
have write caching enabled, and users who would prefer a slow system |
46 |
over one that loses more data when the power goes out should disable |
47 |
caching or buy a UPS. |
48 |
|
49 |
> |
50 |
> nope. |
51 |
|
52 |
Care to actually offer anything constructive? His advice was |
53 |
reasonably well-founded, even if I personally wouldn't do everything |
54 |
exactly as he prefers to do so. |
55 |
|
56 |
-- |
57 |
Rich |