Strange raw tables delete logic
Hi all.
Not understand, why my raw tables are deleted in my environment?
Now in DB:
MariaDB [postal-server-2]> show tables like '%raw%';
+-----------------------------------+
| Tables_in_postal-server-2 (%raw%) |
+-----------------------------------+
| raw-2017-10-21 |
| raw-2017-10-22 |
| raw-2017-10-23 |
| raw-2017-10-24 |
| raw-2017-10-25 |
| raw-2017-10-26 |
| raw-2017-10-27 |
| raw-2017-10-28 |
| raw-2017-10-29 |
| raw-2017-10-30 |
| raw-2017-10-31 |
| raw_message_sizes |
+-----------------------------------+
12 rows in set (0.00 sec)
Settings - > Retention:
- Number of days that raw message data will be stored - 30 days
- Volume of raw message data that will be stored - 20GB
- Number of days of message meta data will be available - 60 days
Raw Message Sizes:
MariaDB [postal-server-2]> select * from raw_message_sizes;
+-----+----------------+-----------+
| id | table_name | size |
+-----+----------------+-----------+
| 109 | raw-2017-10-21 | 790646210 |
| 110 | raw-2017-10-22 | 7978328 |
| 111 | raw-2017-10-23 | 14378471 |
| 112 | raw-2017-10-24 | 7448356 |
| 113 | raw-2017-10-25 | 7370729 |
| 114 | raw-2017-10-26 | 10350620 |
| 115 | raw-2017-10-27 | 10599838 |
| 116 | raw-2017-10-28 | 7033067 |
| 117 | raw-2017-10-29 | 12960488 |
| 118 | raw-2017-10-30 | 13963040 |
| 119 | raw-2017-10-31 | 17468483 |
+-----+----------------+-----------+
11 rows in set (0.00 sec)
Postal Version:
root@send:/opt/postal# postal version
1.0.0-7d2484d47f-stable
OS:
root@send:/opt/postal# cat /etc/os-release
NAME="Ubuntu"
VERSION="16.04.3 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.3 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
DB Version:
root@send:/opt/postal# mysql -V
mysql Ver 15.1 Distrib 10.1.28-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
As per https://github.com/atech/postal/issues/353, I think the size takes priority over the days so you can get this exact situation.
Thanks for reply, but my retension size 20GB and real data size is:
MariaDB [postal-server-2]> select sum(size)/1024/1024 as "Total size, MB" from raw_message_sizes;
+----------------+
| Total size, MB |
+----------------+
| 859.88922119 |
+----------------+
1 row in set (0.00 sec)
Without knowing how big the table was for the 20th, its difficult to know what happened.
It simply deletes one day of email at a time until things go back below the limit.
It's a problem. Now i understand - i must add total raw size in monitoring system. Maybe internal system graph for raw data size is better for situations like this? How can i create Feature Request?
Right now this issue is the best place for it. I think there are some other graph and statistic related requests elsewhere but can't remember where off the top of my head.