Hi
One of the sites I have uses views data export. Nothing fancy, about 20 different views pages that expose data in different formats. The db. admin suddenly sendt me an email that the db. was growing out of space. Had a look and found 21 000 tables views_data_export_index%.

Looged at the code and found the garbage colletor function. Tested that one from drush (drush eval 'views_data_export_garbage_collect(0, -1);') and it had no problems cleaning them all out. Have so fare not been able to track the cause of the problem down. The stray tables are coming back and are rather quickly building up again.

Drupal 7.23
Chaos tool suite 7.x-1.3
Views 7.x-3.7
Views Data Export (views_data_export) 7.x-3.0-beta6

SHOW TABLES LIKE 'views_data_export_index%';
+---------------------------------------------+
| Tables_in_elmcip (views_data_export_index%) |
+---------------------------------------------+
| views_data_export_index_39026               |
| views_data_export_index_39027               |
| views_data_export_index_39028               |
| views_data_export_index_39029               |
| views_data_export_index_39031               |
| views_data_export_index_39032               |
| views_data_export_index_39033               |
| views_data_export_index_39034               |
| views_data_export_index_39035               |
| views_data_export_index_39036               |
+---------------------------------------------+
10 rows in set (0.01 sec)

A few minutes after I cleaned them all out, and they just keep growing. Any pointers to what goes wrong? And, yes, I checked, cron is getting triggered every hour.

Comments

steinmb’s picture

Category: bug » support

Perhaps the site got stale batch jobs? I'm guessing a bit here then I do not know this module all that well. Removed the display I found by looking at views_data_export and flushed the system with views_data_export_garbage_collect().

SELECT eid, view_name, view_display_id, time_stamp, batch_state FROM views_data_export;
+-------+---------------+---------------------+------------+-------------+
| eid   | view_name     | view_display_id     | time_stamp | batch_state |
+-------+---------------+---------------------+------------+-------------+
| 39026 | taxonomy_term | views_data_export_1 | 1380231160 | header      |
| 39027 | taxonomy_term | views_data_export_1 | 1380231456 | header      |
| 39028 | taxonomy_term | views_data_export_1 | 1380231526 | header      |
| 39029 | taxonomy_term | views_data_export_1 | 1380231537 | header      |
| 39030 | taxonomy_term | views_data_export_1 | 1380231552 | finished    |
| 39031 | taxonomy_term | views_data_export_1 | 1380231618 | header      |
| 39032 | taxonomy_term | views_data_export_1 | 1380231676 | header      |
| 39033 | taxonomy_term | views_data_export_1 | 1380231698 | header      |
| 39034 | taxonomy_term | views_data_export_1 | 1380231913 | header      |
| 39035 | taxonomy_term | views_data_export_1 | 1380231943 | header      |
| 39036 | taxonomy_term | views_data_export_1 | 1380231967 | body        |
| 39037 | taxonomy_term | views_data_export_1 | 1380231969 | finished    |
| 39038 | taxonomy_term | views_data_export_1 | 1380232190 | finished    |
| 39039 | taxonomy_term | views_data_export_1 | 1380232195 | body        |
| 39040 | taxonomy_term | views_data_export_1 | 1380232199 | finished    |
| 39041 | taxonomy_term | views_data_export_1 | 1380232299 | header      |
| 39042 | taxonomy_term | views_data_export_1 | 1380232301 | header      |
| 39043 | taxonomy_term | views_data_export_1 | 1380232652 | header      |
| 39044 | taxonomy_term | views_data_export_1 | 1380232757 | header      |
| 39045 | taxonomy_term | views_data_export_1 | 1380232941 | header      |
| 39046 | taxonomy_term | views_data_export_1 | 1380233099 | header      |
| 39047 | taxonomy_term | views_data_export_1 | 1380233214 | header      |
| 39048 | taxonomy_term | views_data_export_1 | 1380233243 | header      |
| 39049 | taxonomy_term | views_data_export_1 | 1380233272 | header      |
| 39050 | taxonomy_term | views_data_export_1 | 1380233303 | header      |
| 39051 | taxonomy_term | views_data_export_1 | 1380233307 | finished    |
| 39052 | taxonomy_term | views_data_export_1 | 1380233313 | body        |
| 39053 | taxonomy_term | views_data_export_1 | 1380233330 | header      |
| 39054 | taxonomy_term | views_data_export_1 | 1380233359 | header      |
| 39055 | taxonomy_term | views_data_export_1 | 1380233388 | header      |
| 39056 | taxonomy_term | views_data_export_1 | 1380233417 | header      |
| 39057 | taxonomy_term | views_data_export_1 | 1380233419 | header      |
| 39058 | taxonomy_term | views_data_export_1 | 1380233464 | header      |
| 39059 | taxonomy_term | views_data_export_1 | 1380233503 | header      |
| 39060 | taxonomy_term | views_data_export_1 | 1380233532 | header      |
| 39061 | taxonomy_term | views_data_export_1 | 1380233561 | header      |
| 39062 | taxonomy_term | views_data_export_1 | 1380233590 | header      |
| 39063 | taxonomy_term | views_data_export_1 | 1380233619 | header      |
| 39064 | taxonomy_term | views_data_export_1 | 1380233648 | header      |
| 39065 | taxonomy_term | views_data_export_1 | 1380233677 | header      |
| 39066 | taxonomy_term | views_data_export_1 | 1380233706 | header      |
| 39067 | taxonomy_term | views_data_export_1 | 1380233735 | header      |
| 39068 | taxonomy_term | views_data_export_1 | 1380233770 | finished    |
| 39069 | taxonomy_term | views_data_export_1 | 1380233801 | header      |
| 39070 | taxonomy_term | views_data_export_1 | 1380233811 | finished    |
| 39071 | taxonomy_term | views_data_export_1 | 1380233814 | header      |
| 39072 | taxonomy_term | views_data_export_1 | 1380233821 | header      |
| 39073 | taxonomy_term | views_data_export_1 | 1380233830 | header      |
| 39074 | taxonomy_term | views_data_export_1 | 1380233872 | header      |
| 39075 | taxonomy_term | views_data_export_1 | 1380233933 | header      |
| 39076 | taxonomy_term | views_data_export_1 | 1380233995 | header      |
| 39077 | taxonomy_term | views_data_export_1 | 1380234092 | header      |
| 39078 | taxonomy_term | views_data_export_1 | 1380234093 | header      |
| 39079 | taxonomy_term | views_data_export_1 | 1380234242 | header      |
| 39080 | taxonomy_term | views_data_export_1 | 1380234546 | finished    |
| 39081 | taxonomy_term | views_data_export_1 | 1380234547 | finished    |
| 39082 | taxonomy_term | views_data_export_1 | 1380234633 | header      |
| 39083 | taxonomy_term | views_data_export_1 | 1380234704 | header      |
| 39084 | taxonomy_term | views_data_export_1 | 1380234705 | header      |
| 39085 | taxonomy_term | views_data_export_1 | 1380234759 | finished    |
| 39086 | taxonomy_term | views_data_export_1 | 1380234762 | finished    |
| 39087 | taxonomy_term | views_data_export_1 | 1380234850 | header      |
| 39088 | taxonomy_term | views_data_export_1 | 1380234965 | finished    |
| 39089 | taxonomy_term | views_data_export_1 | 1380235075 | header      |
| 39090 | taxonomy_term | views_data_export_1 | 1380235170 | finished    |
| 39091 | taxonomy_term | views_data_export_1 | 1380235242 | header      |
| 39092 | taxonomy_term | views_data_export_1 | 1380235266 | header      |
| 39093 | taxonomy_term | views_data_export_1 | 1380235267 | header      |
| 39094 | taxonomy_term | views_data_export_1 | 1380235412 | header      |
| 39095 | taxonomy_term | views_data_export_1 | 1380235583 | header      |
+-------+---------------+---------------------+------------+-------------+
70 rows in set (0.00 sec)
MhueD’s picture

We have an interesting situation which may throw some light on this bug. We have a content entry site that gets 'pushed' up to Production once a day, with no data entry allowed on the target site. Every night we push again and the whole table basis is replaced. In this way, the Production site is entirely secure, and it is 'thrown away' when the next copy is ready with the day's new nodes/changes.

We do not allow the public to enter any new records, as described above, but we DO have Views Data Export attached displays which allow the public to download data. Yesterday we found our MySQL database suddenly growing from 1.5 Gigabytes to 18 Gigabytes and it brought our site down because of settings on our AWS account limiting disc usage for tables.

When we looked at our DB we found what steinmb found above, that 2000 tables had suddenly been declared using the naming convention 'views_data_export_index_X'. ALL of these tables are created quickly, always within the 24-hour period between 'pushes'. Note: the garbage collection function mentioned above DOES work, once the situation is identified...but that is usually too late when the extra tables have brought the site down.

Earlier this year we had gone through a tuning exercise on the Views in question where we turned on Batch Export in the Views UI and adjusted the 'segment size'. If we did NOT use batching we found that there were actually sections of the data set that were not even making it to the output file. Would it be a good idea to possibly present a config that allows the option to have each download garbage collect after the individual job is complete? I am concerned that the regular Cron-hook is being overwhelmed by these enormous numbers of extra tables.