Linux ocfs2 filesystem development
 help / color / mirror / Atom feed
From: Joseph Qi <joseph.qi@huawei.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] Do you know this issue? thanks
Date: Tue, 4 Aug 2015 17:13:02 +0800	[thread overview]
Message-ID: <55C0821E.5030903@huawei.com> (raw)
In-Reply-To: <55C0A054020000F900010CFD@relay2.provo.novell.com>

Hi Gang,

On 2015/8/4 11:21, Gang He wrote:
> Hi Joseph,
> 
> Thank for your good explaining, have more one question.
> 
> 
>>>>
>> Hi Gang,
>> On 2015/8/3 17:28, Gang He wrote:
>>> Hello guys,
>>>
>>> I went through OCFS2 journal and JBD2 code, I just have one question as 
>> below,
>>> If there are some nodes which are running, one node (node A) suddenly 
>> crashes, one another node (node B) will recover node A's journal records. But 
>> here looks a problem, if node B ever changed one file, and node A also 
>> changed this same file, then node B will replay these changed meta buffers, 
>> JBD2 recovery code will memcpy the journal meta buffer to the node B's 
>> memory, this inode's meta buffer will be replaced by node A's journal record, 
>> but this inode structure in memory will not be reflected, this will cause 
>> this kind of issue? I feel that my guess should be wrong, since this problem 
>> looks too obvious, but who can help to figure out how to solve this problem 
>> when a running node try to recover a crashed node's journal.
>>>
>> Please note that nodes can update the same inode only after it has got
>> the cluster lock. And if the lock level is not compatible, it will
>> downcovert first, which will do the checkpoint.
>> So I don't think the issue you described really exists.
> You means, if Node A try to change the same file when Node B is changing (or just changed) this file, it must wait until Node B finishes the checkpoint for these meta buffers,
> then, Node A will re-read these meta buffers from the shared disk and gets the lock, my understanding is right? if yes, how the inode meta buffer reflect the inode structure in the memory?
> There is a case, if Node A ever read a file, then Node B changes the same file and write the journal records to the log file (the meta buffers are not flushed to the file system) and crashes, at this moment, Node A is replaying the journal records and a user is trying to access/change this file, what will happen? the memory inode will be inconsistent with just recovered meta buffer? looks a little complicated.
> 
Node A reads a file (take inode lock, level PR), then Node B changes the
same file (take inode lock, level EX). Here when Node B takes the inode
EX lock, Node A should downcovert to NL because PR and EX are incompatible.
So inode cache in Node A is invalid now.
And only after recovering Node B successfully, Node A can access the file.
(Because lock is holding by Node B).

> Thanks
> Gang   
>  
> 
>>
>> Thanks
>> Joseph
>>>
>>> Thanks
>>> Gang 

  reply	other threads:[~2015-08-04  9:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <55AFBD47020000F90000F7DF@relay2.provo.novell.com>
2015-07-23  2:37 ` [Ocfs2-devel] Do you know this issue? thanks Joseph Qi
2015-07-23  7:14   ` Gang He
2015-08-03  9:28     ` Gang He
2015-08-03 10:21       ` Joseph Qi
2015-08-04  3:21         ` Gang He
2015-08-04  9:13           ` Joseph Qi [this message]
2015-08-05  2:20             ` Gang He
2015-08-05  2:37               ` Joseph Qi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55C0821E.5030903@huawei.com \
    --to=joseph.qi@huawei.com \
    --cc=ocfs2-devel@oss.oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox