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

[gfarm-discuss:04378] Re: replication with file busy



A patch file attached.

Thanks,
Osamu

On Tue, 10 Oct 2006 09:32:34 +0900
Osamu Tatebe <tatebe@xxxxxxxxxxxxxxxx> wrote:

> Hi Fernando,
> 
> "file text busy" in Gfarm file system means some process
> is opening the file in write mode.  In this case, Gfarm
> file system prohibits to create the file replica.
> 
> But, this can happen if you terminate a program by Ctrl-C
> when the program is writing a file unless you use gfarmfs
> to mount Gfarm file system.  
> 
> Even in this case, you can access this file in read-only
> mode by, for example, "gfexport" command, or "cat" command
> via gfarmfs or syscall hooking library.
> 
> When you are sure there is no process writing the file,
> you can unset "file text busy" flag by "gfsplck" command
> after applying the attached patch.
> 
> % gfhost | gfrun -H - gfsplck vm-dfbsateste
> 
> Also, regarding the 'host' entry in host information database,
> it is registered as an alias name of xen01.domain.com.
> If you want to remove it, try
> 
> % gfhost -mA xen01.domain.com
> 
> Thanks,
> Osamu 
> 
> On Tue, 03 Oct 2006 11:07:58 -0300 Fernando Ribeiro da Silva <fernando@xxxxxxxxxxxxx> wrote:
> 
> > Hi all,
> > 
> > 	I'm trying to use gfarm with xen to virtualization.
> > 	I have created loop devices and storage its under the gfarm, it work 
> > fine, live migration working too.
> > 	With fault tolerance tests i look this:
> > 
> > xen01:~# gfhost -l -v
> > 0.00/0.00/0.00 s i386-debian3.0-linux 4 xen01.domain.com(10.10.10.1) host
> > 0.00/0.00/0.01 s i386-debian3.0-linux 4 xen02.domain.com(10.10.10.2)
> > 
> > xen01:~# gfwhere vm-dfbsateste
> > 0: xen01.domain.com
> > 
> > xen01:~# gfrep -N 2 vm-dfbsateste
> > gfrep: replicate gfarm:/root/vm-dfbsateste:0 from xen01.domain.com to 
> > xen02.domain.com: text file busy
> > 
> > 	Is possible to migration a busy file? How are the replication process? 
> > Is a block replication?
> > 
> > 	In the 'gfhost -l -v' I look a work 'host' in end line, what's it mean?
> > 
> > 	Thank you a million by attention.
> > 
> > Best Regards,
> > Fernando Ribeiro
> > 
> > -- 
> > -----------------------------------------------------
> > - Fernando Ribeiro da Silva
> > - RHCE - Red Hat Certified Engineer
> > - LPIC-2 - Advanced Linux
> > - CCSA - CheckPoint Cert. Security Admin.
> > - phone: +1 775 659 7310, +55 61 9115 4852
> > - http://www.musb.org
> > -----------------------------------------------------
> > Firthunands: firthu means peace, nands means daring.
> > "Those who do anything to maintain the peace!"
> > 
> 
Index: lib/libgfarm/gfarm/gfs_pio_misc.c
===================================================================
--- lib/libgfarm/gfarm/gfs_pio_misc.c	(revision 3160)
+++ lib/libgfarm/gfarm/gfs_pio_misc.c	(revision 3161)
@@ -143,7 +143,8 @@
 		e = gfarm_file_section_info_set(gfarm_file, section, &fi);
 	}
 	else if (e == NULL) {
-		if (gfs_file_section_info_check_checksum_unknown(&fi)) {
+		if (gfs_file_section_info_check_checksum_unknown(&fi)
+		    || gfs_file_section_info_check_busy(&fi)) {
 			struct gfarm_file_section_info fi1;
 
 			fi1.filesize = filesize;
@@ -170,6 +171,9 @@
 	if (e == NULL) {
 		e = gfarm_file_section_copy_info_set(
 			gfarm_file, section, fci.hostname, &fci);
+		/* permit GFARM_ERR_ALREADY_EXISTS */
+		if (e == GFARM_ERR_ALREADY_EXISTS)
+			e = NULL;
 	}
 	return (e);
 }
Index: gfptool/gfsplck/gfsplck.c
===================================================================
--- gfptool/gfsplck/gfsplck.c	(revision 3160)
+++ gfptool/gfsplck/gfsplck.c	(revision 3161)
@@ -162,13 +162,8 @@
 	if (strstr(sec, ":::lock"))
 		return ("lock file");
 
-	/* check section busy */
-	e = gfs_file_section_check_busy(gfarm_file, sec);
-	/* allow no fragment case */
-	if (e != NULL && e != GFARM_ERR_NO_SUCH_OBJECT)
-		return (e);
-
-	if (check_all == 0) {
+	if (check_all == 0 && gfs_file_section_check_busy(gfarm_file, sec)
+				!= GFARM_ERR_TEXT_FILE_BUSY) {
 		/* check file size */
 		e = check_file_size(pathname, gfarm_file, sec);
 		if (e != GFARM_ERR_NO_FRAGMENT_INFORMATION && e != NULL)