[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Sharing yum between several machines



On Sun, 2009-03-01 at 17:04 +1030, Tim wrote:
> I don't know how well the system will handle two or more computers
> trying to create the same file on the same disc at the same time.

In fact this can't happen, as the two file-creation operations will be
serialized inside the kernel of the machine the file is physically on.
One of them will win and create the file, the second will try to create
it and then either succeed or fail depending on how the first process
did the creation (see open(2)).

If the second process succeeds, the first process will just continue
merrily writing a file which no longer has a name, so when the process
closes the file it will disappear and the space will be reclaimed.
Meanwhile the second process meanwhile will be writing to a completely
different file, which does have a name.

If the second process fails to create the file, it'll get a
file-creation error and presumably report to the user (in fact to the
NFS client in this case).

There is an exception to all this: if the file is created in APPEND
mode, you can get corruption of the file (not the system). RTFM.

poc


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]