Re: Files dropping out of index??? (beagle-0.2.16.3)



On Monday 07 May 2007 12:00, Henry S. Thompson wrote:
> I'm losing all the files from my index!?

I had the same problem, until I patched beagle with
the attached patch by D. 
Bera. If you see the message "found dangling locks,
purging index" or 
something similar, you can use the attached patch,
which applies to beagle 
0.2.16.3.

Regards.



 
____________________________________________________________________________________
Get your own web address.  
Have a HUGE year through Yahoo! Small Business.
http://smallbusiness.yahoo.com/domains/?p=BESTDEAL
Index: Store/FSDirectory.cs
===================================================================
--- Store/FSDirectory.cs	(revision 3170)
+++ Store/FSDirectory.cs	(working copy)
@@ -133,29 +133,20 @@
 			{
 				if (Lucene.Net.Store.FSDirectory.disableLocks || Enclosing_Instance.InstanceDisableLock)
 					return ;
-				bool tmpBool;
-				if (System.IO.File.Exists(lockFile.FullName))
-				{
-					System.IO.File.Delete(lockFile.FullName);
-					tmpBool = true;
-				}
-				else if (System.IO.Directory.Exists(lockFile.FullName))
-				{
-					System.IO.Directory.Delete(lockFile.FullName);
-					tmpBool = true;
-				}
-				else
-					tmpBool = false;
+
+				int fd = Mono.Unix.Native.Syscall.unlink (
+		    		    	lockFile.FullName);
+		    		if (fd == -1)
+					throw new System.IO.IOException (
+						"Could not release lock file: "
+						+ Mono.Unix.Native.Stdlib.strerror (Mono.Unix.Native.Stdlib.GetLastError ()
+					));
+
 				if (System.IO.File.Exists(lockFile.FullName)) {
-					Log ("Release didnt delete lockfile {0}.", lockFile.FullName);
-					tmpBool = false;
+					Beagle.Util.Logger.Log.Warn ("Release didnt delete lockfile {0}.", lockFile.FullName);
 				}
-				bool generatedAux = tmpBool;
-				if (tmpBool)
-					Log ("Released lock {0}", lockFile.FullName);
-				else
-					Log ("Failed to release lock {0}", lockFile.FullName);
 			}
+
 			public override bool IsLocked()
 			{
 				if (Lucene.Net.Store.FSDirectory.disableLocks || Enclosing_Instance.InstanceDisableLock)


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