Coda File System

Re: corruption question?

From: lou <lou_at_0xffff.org>
Date: Tue, 8 Jul 2003 17:11:43 +0100
In some email I received from Jan Harkes <jaharkes_at_cs.cmu.edu> on Tue, 8 Jul 2003 11:39:45
-0400, wrote:

> On Tue, Jul 08, 2003 at 03:27:41PM +0100, lou wrote:
[...]
> AFS3 concurrent O_RDWR scenario
> 
>     client2
> 	foo = open('foo', O_RDWR);
> 	write(foo, "a");
> 
>     client1
> 	foo = open('foo', O_RDWR);
> 	write(foo, "test");
> 	close(foo);
> 	/* foo now contains "test" */
> 
>     client2
> 	close(foo);
> 	/* surprise! foo now contains "t" */

You mean 'a' not 't' right?

> I actually like it that Coda gives me a conflict in these situations, at
> least I get to keep both pieces.

That's good enough, but wont it be more sensible instead of taking a whole volume into a
disconnect write mode to happen something like:
 
	stat(file,..) // == foo
	if(open-with-rw){ read(file) && write(file-temp) 
        file = file-temp; } // copy the content into a different file content
+warning		
       foo = open(file, O_RDWR);
 	//  do writes/reads 

The first win, and the last will have to merge files locally if someone wants to write
in them. But that option should be available only in times of RW rather than reads,
none of those reads would pass the (open-with-rw) condition..
have a weird feeling that this will hit the performance.

Actually I havent thought too much about it in general, since I know that merging content
of files (especially binaries or db files) is not an easy job, at least not so easy to
automate. But there are still few workarounds which can be done. 

Just brainstorming around.

Thanks.

cheers
-lou
Received on 2003-07-08 12:14:42
Binary file ./codalist-2003/5384.html matches