* how do versioning filesystems take snapshot of opened files?
@ 2007-07-03 5:28 Xin Zhao
[not found] ` <778391c50707022236v5157a933qea1994cf4cbce879@mail.gmail.com>
2007-07-03 13:09 ` Chris Mason
0 siblings, 2 replies; 5+ messages in thread
From: Xin Zhao @ 2007-07-03 5:28 UTC (permalink / raw)
To: linux-fsdevel, linux-kernel
Hi,
If a file is already opened when snapshot command is issued, the file
itself could be in an inconsistent state already. Before the file is
closed, maybe part of the file contains old data, the rest contains
new data.
How does a versioning filesystem guarantee that the file snapshot is
in a consistent state in this case?
I googled it but didn't find any answer. Can someone explain it a little bit?
Thanks
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: how do versioning filesystems take snapshot of opened files?
[not found] ` <778391c50707022236v5157a933qea1994cf4cbce879@mail.gmail.com>
@ 2007-07-03 5:44 ` Xin Zhao
0 siblings, 0 replies; 5+ messages in thread
From: Xin Zhao @ 2007-07-03 5:44 UTC (permalink / raw)
To: Sunil Joshi; +Cc: linux-fsdevel, linux-kernel
I do know how copy-on-write works. But this seems insufficient to
address the problem I asked.
One possible way is to modify the filesystem so that when a file is
opened for write, we always keep a copy of the file's metadata and a
CoW bitmap. For subsequent writes, we first copy the old data to
somewhere else in memory for backup, mark the CoW bitmap, and then
write to the file. The temporary data is discarded when the file is
closed. By checking the CoW bitmap, the backup application can
determine which data it should copy to the backup media.
This solution can address this problem. But it requires copy-on-write
on every write, no matter whether there is a backup operation. I
suspect that this solution will impact the system performance (at
least write performance) quite a bit and consume more memory.
Any further thought?
Thanks!
On 7/3/07, Sunil Joshi <mail2joshi@gmail.com> wrote:
> It depends how snapshot is being taken. Usually it is Copy On Write. Google
> for Copy on Write and you will find the answer for this.
>
>
>
>
> On 7/3/07, Xin Zhao <uszhaoxin@gmail.com> wrote:
> >
> > Hi,
> >
> >
> > If a file is already opened when snapshot command is issued, the file
> > itself could be in an inconsistent state already. Before the file is
> > closed, maybe part of the file contains old data, the rest contains
> > new data.
> > How does a versioning filesystem guarantee that the file snapshot is
> > in a consistent state in this case?
> >
> > I googled it but didn't find any answer. Can someone explain it a little
> bit?
> >
> > Thanks
> > -
> > To unsubscribe from this list: send the line "unsubscribe linux-fsdevel"
> in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at
> http://vger.kernel.org/majordomo-info.html
> >
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: how do versioning filesystems take snapshot of opened files?
2007-07-03 5:28 how do versioning filesystems take snapshot of opened files? Xin Zhao
[not found] ` <778391c50707022236v5157a933qea1994cf4cbce879@mail.gmail.com>
@ 2007-07-03 13:09 ` Chris Mason
2007-07-03 16:12 ` Xin Zhao
2007-07-03 22:02 ` Neil Brown
1 sibling, 2 replies; 5+ messages in thread
From: Chris Mason @ 2007-07-03 13:09 UTC (permalink / raw)
To: Xin Zhao; +Cc: linux-fsdevel, linux-kernel
On Tue, 3 Jul 2007 01:28:57 -0400
"Xin Zhao" <uszhaoxin@gmail.com> wrote:
> Hi,
>
>
> If a file is already opened when snapshot command is issued, the file
> itself could be in an inconsistent state already. Before the file is
> closed, maybe part of the file contains old data, the rest contains
> new data.
> How does a versioning filesystem guarantee that the file snapshot is
> in a consistent state in this case?
>
> I googled it but didn't find any answer. Can someone explain it a
> little bit?
It's the same answer as in most filesystem related questions...it
depends ;) Consistent state means many different things. It may mean
that the metadata accurately reflects the space on disk allocated to
the file and that all data for the file is properly on disk (ie from an
fsync).
But, even this is less than useful because very few files on the
filesystem stand alone. Applications spread their state across a
number of files and so consistent means something different to
every application.
Getting a snapshot that is useful with respect to application data
requires help from the application. The app needs to be shutdown or
paused prior to the snapshot and then started up again after the
snapshot is taken.
-chris
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: how do versioning filesystems take snapshot of opened files?
2007-07-03 13:09 ` Chris Mason
@ 2007-07-03 16:12 ` Xin Zhao
2007-07-03 22:02 ` Neil Brown
1 sibling, 0 replies; 5+ messages in thread
From: Xin Zhao @ 2007-07-03 16:12 UTC (permalink / raw)
To: Chris Mason; +Cc: linux-fsdevel, linux-kernel
Thanks for your reply.
Sounds like one has to stop or pause the applications to get
consistent snapshot? But you look around, you may find that many
systems claim that they can take snapshot without shutdown the
application. Actually, I think it is impractical to require that app
to be shutdown before taking snapshot in a commercial environment.
Pausing apps is possible from the filesystem perspective. A simple
solution is that the filesystem stop writing any data to disk from the
point that the snapshotting command is received. But as we discussed
earlier, this is not sufficient to prevent a file from containing part
of old data and part of new data.
That's why I am so confused how can these systems provide consistent
snapshotting capability without sacrificing system performance much.
On 7/3/07, Chris Mason <chris.mason@oracle.com> wrote:
> On Tue, 3 Jul 2007 01:28:57 -0400
> "Xin Zhao" <uszhaoxin@gmail.com> wrote:
>
> > Hi,
> >
> >
> > If a file is already opened when snapshot command is issued, the file
> > itself could be in an inconsistent state already. Before the file is
> > closed, maybe part of the file contains old data, the rest contains
> > new data.
> > How does a versioning filesystem guarantee that the file snapshot is
> > in a consistent state in this case?
> >
> > I googled it but didn't find any answer. Can someone explain it a
> > little bit?
>
> It's the same answer as in most filesystem related questions...it
> depends ;) Consistent state means many different things. It may mean
> that the metadata accurately reflects the space on disk allocated to
> the file and that all data for the file is properly on disk (ie from an
> fsync).
>
> But, even this is less than useful because very few files on the
> filesystem stand alone. Applications spread their state across a
> number of files and so consistent means something different to
> every application.
>
> Getting a snapshot that is useful with respect to application data
> requires help from the application. The app needs to be shutdown or
> paused prior to the snapshot and then started up again after the
> snapshot is taken.
>
> -chris
>
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: how do versioning filesystems take snapshot of opened files?
2007-07-03 13:09 ` Chris Mason
2007-07-03 16:12 ` Xin Zhao
@ 2007-07-03 22:02 ` Neil Brown
1 sibling, 0 replies; 5+ messages in thread
From: Neil Brown @ 2007-07-03 22:02 UTC (permalink / raw)
To: Chris Mason; +Cc: Xin Zhao, linux-fsdevel, linux-kernel
On Tuesday July 3, chris.mason@oracle.com wrote:
>
> Getting a snapshot that is useful with respect to application data
> requires help from the application.
Certainly.
> The app needs to be shutdown or
> paused prior to the snapshot and then started up again after the
> snapshot is taken.
Alternately, the app needs to be able to cope with unexpected system
shutdown (aka crash) and the same ability will allow it to cope with
an atomic snapshot. It may be able to recover more efficiently from
an expected shutdown, so being able to tell the app about an impending
snapshot is probably a good idea, but it should be advisory only.
NeilBrown
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-07-03 22:03 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-03 5:28 how do versioning filesystems take snapshot of opened files? Xin Zhao
[not found] ` <778391c50707022236v5157a933qea1994cf4cbce879@mail.gmail.com>
2007-07-03 5:44 ` Xin Zhao
2007-07-03 13:09 ` Chris Mason
2007-07-03 16:12 ` Xin Zhao
2007-07-03 22:02 ` Neil Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox