>Message: 5 >Date: Fri, 1 Apr 2011 21:14:15 +0100 >From: John Gardner <john.gard...@southtyneside.gov.uk> >Subject: Re: [Ocfs2-users] Anomaly when writing to OCFS2 >To: Sunil Mushran <sunil.mush...@oracle.com> >Cc: "ocfs2-users@oss.oracle.com" <ocfs2-users@oss.oracle.com> >Message-ID: > <0ef7337f42b8b0428c06290dc305ea4302ecb4c4f...@st1aa2v00009.stc.local> >Content-Type: text/plain; charset=us-ascii > > >So everything works fine as long as the temp file is being written to. > >The out file is the issue. > >Not exactly, the temp file is always written to whether the temp >file is located on OCFS2 or sym linked to the EXT3 partition. The >problem occurs right at the end of the process; > >When tmp file is located on OCFS2, the log file is written to it, >the log file completes, creates the out file (wth nothing in it) and >resets the tmp file to 0kb. >When tmp file is located on EXT3, the log file is written to it, the >log file completes, creates the outfile and copies the contents to >it, then resets the tmp file to 0kb. > > >How is the file copied from temp to out? > >mv? cp? > >And please don't guess. > >This copying action is a standard Oracle Concurrent Manager action >so I have no way of knowing how Oracle is programmatically >performing this, as it is Oracle code. > >Regards > >John
It sounds to me like the Oracle process isn't actually copying the file, but cheating and using a hard link. So when you have this out file, it's actually a pointer to the same inode that the log file points at. Then, when you zero the log file, you are truncating the same inode shared with the out file, thus it gets truncated as well. However, if this were the case, subsequent writes to the log file should be visible in the out file as well. Is that the case? Also, if the above is the case, it makes sense that this behavior doesn't happen when the log and out files are on different filesystems as you cannot hard link across that boundary, thus it makes a proper copy instead. It might be interesting to use tools like strace and blktrace to see what the Oracle program is really doing at the I/O layer in each scenario. _______________________________________________ Ocfs2-users mailing list Ocfs2-users@oss.oracle.com http://oss.oracle.com/mailman/listinfo/ocfs2-users