[Xapian-discuss] xapian-compact and "Bad line 1 in stub database file"

Adam Sjøgren asjo at koldfront.dk
Wed Oct 8 19:39:16 BST 2008


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




More information about the Xapian-discuss mailing list