Fix for multi-user database corruption problems just checked in.
jra at samba.org
Wed Mar 13 12:41:15 GMT 2002
I discovered something today. I was given a test
prgram by "Gerald Drouillard" <gerald at drouillard.ca> that
allowed me to completely reproduce foxpro database corruption
to a Samba 2.2.3a server - guarenteed.
Ths same program did not fail when run against a W2K
It was complaining about lock violations. Now Andrew's
smbtorture lock tester does a *complete* test of
our locking code against W2K and we pass as identical,
so I really doubted that we were getting the lock
semantics wrong, especially as these were very simple
One strange thing with the lock tests though - Samba
is *much* faster at completing the smbtorture tests than Windows
2000 - which made me start to wonder.
So I did some digging.......
It turns out that when a Windows client asks for a lock,
and tells the server that the timeout is zero (ie. don't
wait to get the lock, just check *right now* to see if
you could get it), then a W2K server seems to do a very strange
thing. It apparently *spins* for a short time trying to get the
lock - it *doesn't* respond immediately ! Samba wasn't doing
And of course :-), the Foxpro database code seems to be dependent
on this behavior.
I have just added some code to Samba (SAMBA_2_2 and HEAD)
to force Samba to spin a parameter dependent number of times
and also to usleep a parameter dependent time between attempts.
Currently I have these set to 3 spins and 10usecs.
When I do this the test program passes *perfectly* against
a SAMBA_2_2 CVS and HEAD server.
So, for people whe are experiencing MS Access and Foxpro
database corruption problems I'd appreciate it if you
could check this new code out and test it - I think this
is the answer (it also fully explains why W2K is so slow
on the lock tester as well :-) to fix the database corruption
Let me know.....
More information about the samba-technical