pilerpurge does not work

Issue #237 resolved
s s created an issue

Hello,

we have latest piler installed:

piler 0.1.25-master-branch, build 857

Here is result of pilerpurge from log:

Jan 20 06:40:32 pilerpurge[604]: purge sql: *SELECT `id`, `piler_id`, `size` FROM `metadata` WHERE `deleted`=0 AND `retained` < 1390218032 AND attachments=0*
Jan 20 06:40:32 pilerpurge[604]: purge sql: *SELECT `piler_id`, `size` FROM `metadata` WHERE `deleted`=0 AND `retained` < 1390218032 AND attachments > 0*
Jan 20 06:40:32 pilerpurge[604]: purge sql: *SELECT `id`, `piler_id`, `size` FROM `metadata` WHERE `deleted`=0 AND `retained` < 1390218032 AND attachments > 0*
Jan 20 06:40:32 pilerpurge[604]: purged 0 messages, 5050 bytes

This is a fresh installation and after process 10 test email i set retained = 1295519459 for these 2 mails.

From mysql 1st query return results:

mysql> SELECT `id`, `piler_id`, `size` FROM `metadata` WHERE `deleted`=0 AND `retained` < 1390217309 AND attachments=0;
+----+--------------------------------------+------+
| id | piler_id                             | size |
+----+--------------------------------------+------+
|  1 | 4000000052d7c36d097f1184002af8fa4fe7 |  709 |
|  2 | 4000000052d7ca77093cf7a40057b4dc6b8b | 4341 |

Another mysql requests return zero and piler did not purge 2 email.

Periodic purge is enabled on health page. On previous installation piler 0.1.24 timestamp modification worked for me.

Comments (10)

  1. Janos SUTO repo owner

    Please show me the output of the following query:

    SELECT id, piler_id, retained,size FROM metadata WHERE deleted=0 AND retained < 1390217309 AND attachments=0;

    And the output of "pilerpurge -d" (it's a dry run mode).

    I think there was a problem removing the messages files from the store directory.

  2. s s reporter

    Here is the output

    mysql> SELECT id, piler_id, retained,size FROM metadata WHERE deleted=0 AND retained < 1390217309 AND attachments=0;
    +----+--------------------------------------+------------+------+
    | id | piler_id                             | retained   | size |
    +----+--------------------------------------+------------+------+
    |  1 | 4000000052d7c36d097f1184002af8fa4fe7 | 1295519459 |  709 |
    |  2 | 4000000052d7ca77093cf7a40057b4dc6b8b | 1295519459 | 4341 |
    +----+--------------------------------------+------------+------+
    

    "pilerpurge -d" return new line, no output

  3. s s reporter

    What is purpose of query parts

    AND attachments = 0
    AND attachments > 0
    

    Can you remove them from piler purge sql and leave without "AND attachments" ?

  4. Janos SUTO repo owner

    Sorry for the slow response. I delete message in 2 rounds, because if a message has an attachment, then it should be deleted as well, and I have to check for any reference from another message (because of deduplication).

    Give me some more time to nail down this issue.

  5. Ashok Kumar

    Hi,

    I have same problem in the version piler-1.2.0 to remove the message files from store directory. when i run the command 'pilerpurge -d' , it shows the retention mails to remove. But it is not removing with 'pilerpurge'.

    To make "pilerpurge" work the following change have done

    **Line No 259 in src/pilerpurge.c

    "unsigned int blen=0, ulen=0;--> unsigned int blen=9192, ulen=0;"**

    Now the mails are getting removed from the store directory. It worked for me with 'pilerexport -A',deleted mails are not exported to current directory.

    Please give your feedback.

  6. Log in to comment