<!DOCTYPE html><html><head><title></title><style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div style="font-family:Arial;">On Sat, Jun 1, 2019, at 04:34, Dilyan Palauzov wrote:<br></div><blockquote type="cite" id="qt"><div style="font-family:Arial;">Hello,<br></div><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">I gave squatter -F a try.<br></div><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">Before I run it for a user tier T1 was not compacted and allocated 3,4  <br></div><div style="font-family:Arial;">MB (mega), T2 was compacted and contained 3.7GB (giga).  After  <br></div><div style="font-family:Arial;">removing the records of the deteled messages, say running squatter -F  <br></div><div style="font-family:Arial;">T2 was 5.7GB and squatter printed “filtering” instead of “compacting”.  <br></div><div style="font-family:Arial;">  Then I run again “squatter -t T1,T2 -z T2” without -F, without -X  <br></div><div style="font-family:Arial;">and squatter reindexed all messages, to create a 3.0 GB index.<br></div><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">I expected, that using -F the resulting database will be compacted and  <br></div><div style="font-family:Arial;">on the second call there will be no reindexing.<br></div></blockquote><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">I discovered some bad bugs in -F recently, so I suspect that's why.  They should be fixed on master now.<br></div><div style="font-family:Arial;"><br></div><blockquote type="cite" id="qt"><div style="font-family:Arial;">When does squatter decide on its own to reindex?<br></div></blockquote><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">When the DB version is too old (which is one of the -F bugs - it wasn't setting the DB version, so it assumed the data was all version zero!)<br></div><div style="font-family:Arial;"><br></div><blockquote type="cite" id="qt"><div style="font-family:Arial;">What do G records in conversations.db contain?<br></div></blockquote><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">G records contain a mapping from GUID to folder number (offset into the $FOLDER_NAMES key) and UID and optionally IMAP part number as the key - mapping to values which contain some keywords and modseq from the original record as well.<br></div><div style="font-family:Arial;"><br></div><blockquote type="cite" id="qt"><div style="font-family:Arial;">My reading is that the way to create a Xapian index of an indexed  <br></div><div style="font-family:Arial;">mailbox, is that first squatter has to be run in INDEX mode and then  <br></div><div style="font-family:Arial;">in COMPACT mode.  In particular it is not possible to create in one  <br></div><div style="font-family:Arial;">step a compacted database.<br></div></blockquote><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">No, it's not - due to the way to compact API works.  At least, I haven't figured out how.<br></div><div style="font-family:Arial;"><br></div><blockquote type="cite" id="qt"><div style="font-family:Arial;">Does squatter -R -S sleep after each mailbox or after each message indexed?<br></div></blockquote><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">It sleeps after each mailbox.<br></div><div style="font-family:Arial;"><br></div><blockquote type="cite" id="qt"><div style="font-family:Arial;">When compacting, squatter deals just with messages and on search or  <br></div><div style="font-family:Arial;">reindex the conversations.db is used to map the messages to mailboxes.  <br></div><div style="font-family:Arial;">  How does squatter -S sleep after each mailbox during compacting, if  <br></div><div style="font-family:Arial;">it knows nothing about mailboxes?<br></div></blockquote><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">-S is not used when compacting.<br></div><div style="font-family:Arial;"><br></div><blockquote type="cite" id="qt"><div style="font-family:Arial;">What does mean a tier name in a xapianactive file without a number?<br></div></blockquote><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">that shouldn't happen.  It will be parsed as the same as tier:0 I believe.<br></div><div style="font-family:Arial;"><br></div><blockquote type="cite" id="qt"><div style="font-family:Arial;">What are XAPIAN_DBW_CONVINDEXED and _XAPINDEXED?<br></div></blockquote><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">Two different ways to know if a document is indexed.  CONVINDEXED uses the conversations DB to look up mailbox and uid and then the cyrus.indexed.db databases to see if the message has already been seen.<br></div><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">XAPINDEXED uses the metadata inside the Xapian databases to know if a particular message has been indexed based on the cyrusid.*G* metadata values which are identical to the GUIDs themselves.<br></div><div style="font-family:Arial;"><br></div><blockquote type="cite" id="qt"><div style="font-family:Arial;">What does the file sync/squatter?<br></div></blockquote><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">It's a sync/$channel directory which squatter watches on.  This is a method for providing a queue of mailboxes to look at based on the APPEND sync_log statements.<br></div><div style="font-family:Arial;"><br></div><blockquote type="cite" id="qt"><div style="font-family:Arial;">squatter can print “Xapian: truncating text from message mailbox  <br></div><div style="font-family:Arial;">user.... uid 7309”.  When are messages truncated for the purposes of  <br></div><div style="font-family:Arial;">indexing?<br></div></blockquote><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">When they are too long!  The comment in the source code says this:<br></div><div style="font-family:Arial;"><br></div><div style="font-family:Arial;"><span style="font-family: menlo, consolas, monospace, sans-serif;" class="font">/* Maximum size of a query, determined empirically, is a little bit</span><span style="font-family: menlo, consolas, monospace, sans-serif;" class="font"><br></span></div><div style="font-family:Arial;"><span style="font-family: menlo, consolas, monospace, sans-serif;" class="font">* under 8MB.  That seems like more than enough, so let's limit the</span><span style="font-family: menlo, consolas, monospace, sans-serif;" class="font"><br></span></div><div style="font-family:Arial;"><span style="font-family: menlo, consolas, monospace, sans-serif;" class="font">* total amount of parts text to 4 MB. */</span><span style="font-family: menlo, consolas, monospace, sans-serif;" class="font"><br></span></div><div style="font-family:Arial;"><span style="font-family: menlo, consolas, monospace, sans-serif;" class="font">#define MAX_PARTS_SIZE      (4*1024*1024)</span><br></div><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">This is a holdover from when Greg was working on it.  We could switch this to be a configurable option.<br></div><div style="font-family:Arial;"><br></div><blockquote type="cite" id="qt"><div style="font-family:Arial;">Do I understand correctly, that for a Xapianactive file with "A B C D  <br></div><div style="font-family:Arial;">E", to remove C one has to call "squatter -t C,D -z D".  But A cannot  <br></div><div style="font-family:Arial;">be removed, if it the defaultsearchtier.  Is the defaultsearchtier  <br></div><div style="font-family:Arial;">always included in the xapianactive file, if the tier is missing,  <br></div><div style="font-family:Arial;">whenever the file is modified (and the only way to modify it is to  <br></div><div style="font-family:Arial;">call squatter in COMPACT mode)?<br></div></blockquote><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">When you do any compact, if it includes the first item (the writable database) then a new writable database will be created on the default tier.  So if you try to compact the default tier away, a new default tier item will be created.<br></div><div style="font-family:Arial;"><br>Bron.<br></div><div style="font-family:Arial;"><br></div><div id="sig56629417"><div class="signature">--<br></div><div class="signature">  Bron Gondwana, CEO, FastMail Pty Ltd<br></div><div class="signature">  brong@fastmailteam.com<br></div><div class="signature"><br></div></div><div style="font-family:Arial;"><br></div></body></html>