Bug 762615 (GLUSTER-883) - Data corruption due to thread unsafe reads and writes
Summary: Data corruption due to thread unsafe reads and writes
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: GLUSTER-883
Product: GlusterFS
Classification: Community
Component: posix
Version: mainline
Hardware: All
OS: Linux
urgent
medium
Target Milestone: ---
Assignee: Shehjar Tikoo
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-05-04 07:30 UTC by Shehjar Tikoo
Modified: 2015-12-01 16:45 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Regression: RTP
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:


Attachments (Terms of Use)

Description Shehjar Tikoo 2010-05-04 07:30:45 UTC
io-threads, till a few weeks back, used to channel all operations on a particular inode over the same thread so that there are no race conditions due to writes over-taking each other.

Recent changes in iothreads have ensured that this race condition is hit very easily. io-threads fires new threads to handle requests when it sees that the queue length is increasing beyond a certain point. Queue length increases can happen due to a slow disk or due to O_SYNC or O_DIRECT writes and in other cases also. The logic has also changed to allow multiple threads to serve fops for the same file. The race condition occurs in posix, where the lseek-readv or lseek-writev sequence is not a critical section, such that lseek of thread1 can be followed by lseek of thread2, resulting in a write on offset of thread2 by both threads. This results in a data corruption.

Comment 1 Anand Avati 2010-05-05 08:36:08 UTC
PATCH: http://patches.gluster.com/patch/3224 in master (posix: Support thread-safe vectored writes/reads)


Note You need to log in before you can comment on or make changes to this bug.