Adam Sjøgren
2008-Oct-08 18:39 UTC
[Xapian-discuss] xapian-compact and "Bad line 1 in stub database file"
I have a xapian index on a test-machine that has been used quite a bit. The size of the index on disk is 2.4GB, so I thought I'd run xapian-compact on it, to make it more likely to fit in RAM. It went like this: $ time xapian-compact index index.compact postlist: Reduced by 50.0176% 387080K (773888K -> 386808K) record: Reduced by 40.8424% 5120K (12536K -> 7416K) termlist: Reduced by 42.869% 62064K (144776K -> 82712K) position: Reduced by 44.1926% 651760K (1474816K -> 823056K) value: Reduced by 47.2156% 6376K (13504K -> 7128K) spelling: Size unchanged (0K) synonym: Size unchanged (0K) real 7m18.317s user 0m46.211s sys 0m10.477s $ A nice reduction to 1.3GB. But when I try to use the new index in place of the non-compact one, it doesn't work, the application says: Exception: Bad line 1 in stub database file `index.compact/postlist.baseA' at /usr/lib/perl5/Search/Xapian/Database.pm line 48 If I look at the file-size: -rw-rw-r-- 1 adsj staff 13 2008-10-08 20:01 index.compact/postlist.baseA compared to the original; they differ in size?: -rw-r--r-- 1 adsj staff 12084 2008-10-08 18:02 index/postlist.baseA But I haven't tried to look into it further, I hope you can give me a hint of what I am doing wrong, or if I've hit a bug. I am using Xapian 1.0.5 on an Ubuntu hardy amd64 machine. I briefly scanned the NEWS-file, but didn't find anything sounding like this problem; I will of course try upgrading to the latest version if it is likely to help. I closed down my indexing process while compacting, so there was nothing to "interfere", as far as I could see. Best regards, Adam ? The compact one is so small, that I might as well include it here: $ hexdump -C postlist.baseA 00000000 00 05 80 40 00 00 00 00 00 01 01 00 00 |... at .........| 0000000d -- "On the quiet side. Somewhat peculiar. A good Adam Sj?gren companion, in a weird sort of way." asjo at koldfront.dk
Olly Betts
2008-Oct-09 01:21 UTC
[Xapian-discuss] xapian-compact and "Bad line 1 in stub database file"
On Wed, Oct 08, 2008 at 08:39:16PM +0200, Adam Sj?gren wrote:> But when I try to use the new index in place of the non-compact one, it > doesn't work, the application says: > > Exception: Bad line 1 in stub database file `index.compact/postlist.baseA' at > /usr/lib/perl5/Search/Xapian/Database.pm line 48Are you perhaps trying to open "index.compact/postlist.baseA" as a database (rather than "index.compact")?> If I look at the file-size: > > -rw-rw-r-- 1 adsj staff 13 2008-10-08 20:01 index.compact/postlist.baseA > > compared to the original; they differ in size?: > > -rw-r--r-- 1 adsj staff 12084 2008-10-08 18:02 index/postlist.baseAThat's OK - after compaction, the "A" revision is for an empty table, the "B" revision is for the table with all the data added.> I am using Xapian 1.0.5 on an Ubuntu hardy amd64 machine. I briefly > scanned the NEWS-file, but didn't find anything sounding like this > problem; I will of course try upgrading to the latest version if it is > likely to help.If it's not the database path, please try 1.0.8. Cheers, Olly