Lana Deere
2010-Oct-29 21:05 UTC
[Gluster-users] concurrent write and read to the same file
GlusterFS 3.1.0, distributed volumes, rdma transport, CentOS 5.4/5.5.
I was doing "tail -f" on a log file while the program generating it
was running and noticed some strange behavior. I wasn't able to
reproduce exactly the same strange behavior, but here is some which
did reproduce for me reliably. This is a small perl program producing
a bit of output every few seconds:
$| = 1;
for ($i=0; $i < 100; ++$i) {
printf("This is line $i\n");
sleep(3);
}
If I run it with output sent to a gluster volume,
perl foo.pl > bar
it works fine: "bar" has the right content after the script
terminates, or if I kill the script while it runs "bar" has a valid
partial output.
While the perl script is running, if I log into a different host which
can see that volume and do "tail -f bar" that also works fine: every
few seconds, the next line of output appears.
However, while the perl script is running if I do "tail -f bar" from
the same host as the script is running on, it will print me the
current end of the file but then it will hang without producing any
subsequent output. This is true whether or not I have a tail running
on a different host concurrently.
The tail on the same host as the script will correctly notice that the
file was reset if I kill and restart the perl script while leaving the
tail running. Then it prints the first line, but at that point it
hangs again.
Anyone else seeing this? Any ideas what might be reasons why?
Thanks!
.. Lana (lana.deere at gmail.com)
Burnash, James
2010-Nov-01 14:31 UTC
[Gluster-users] concurrent write and read to the same file
Hi Lana.
Looks like you may have run into this bug as well:
http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2027
James Burnash, Unix Engineering
-----Original Message-----
From: gluster-users-bounces at gluster.org [mailto:gluster-users-bounces at
gluster.org] On Behalf Of Lana Deere
Sent: Friday, October 29, 2010 5:06 PM
To: gluster-users at gluster.org
Subject: [Gluster-users] concurrent write and read to the same file
GlusterFS 3.1.0, distributed volumes, rdma transport, CentOS 5.4/5.5.
I was doing "tail -f" on a log file while the program generating it
was running and noticed some strange behavior. I wasn't able to
reproduce exactly the same strange behavior, but here is some which
did reproduce for me reliably. This is a small perl program producing
a bit of output every few seconds:
$| = 1;
for ($i=0; $i < 100; ++$i) {
printf("This is line $i\n");
sleep(3);
}
If I run it with output sent to a gluster volume,
perl foo.pl > bar
it works fine: "bar" has the right content after the script
terminates, or if I kill the script while it runs "bar" has a valid
partial output.
While the perl script is running, if I log into a different host which
can see that volume and do "tail -f bar" that also works fine: every
few seconds, the next line of output appears.
However, while the perl script is running if I do "tail -f bar" from
the same host as the script is running on, it will print me the
current end of the file but then it will hang without producing any
subsequent output. This is true whether or not I have a tail running
on a different host concurrently.
The tail on the same host as the script will correctly notice that the
file was reset if I kill and restart the perl script while leaving the
tail running. Then it prints the first line, but at that point it
hangs again.
Anyone else seeing this? Any ideas what might be reasons why?
Thanks!
.. Lana (lana.deere at gmail.com)
_______________________________________________
Gluster-users mailing list
Gluster-users at gluster.org
http://gluster.org/cgi-bin/mailman/listinfo/gluster-users
DISCLAIMER:
This e-mail, and any attachments thereto, is intended only for use by the
addressee(s) named herein and may contain legally privileged and/or confidential
information. If you are not the intended recipient of this e-mail, you are
hereby notified that any dissemination, distribution or copying of this e-mail,
and any attachments thereto, is strictly prohibited. If you have received this
in error, please immediately notify me and permanently delete the original and
any copy of any e-mail and any printout thereof. E-mail transmission cannot be
guaranteed to be secure or error-free. The sender therefore does not accept
liability for any errors or omissions in the contents of this message which
arise as a result of e-mail transmission.
NOTICE REGARDING PRIVACY AND CONFIDENTIALITY Knight Capital Group may, at its
discretion, monitor and review the content of all e-mail communications.
http://www.knight.com