Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: Mr. Jinx on July 20, 2014, 03:32:52 PM

Title: Empty trashcan, random topics get deleted
Post by: Mr. Jinx on July 20, 2014, 03:32:52 PM
I'm not sure if this is a bug or something weird on my server:

Situation:
All deleted posts end up in the trashcan (yes that is correct :)).
So lets say at some point there are 5 pages of trash in the trashcan.
Once in a while I clean up the trashcan by selecting the last page (page 5), and there I select all trashed posts and delete them for ever.

This takes a few seconds and then you return to the trashcan, but the weird thing is, there are still 5 pages of trash and all pages are full with deleted postings.
If you wait a few minutes, everything will be updates and you will finally see 4 pages left.

However, if you don't know this and select all posts on page 5 again, random normal topics will be deleted!
This has corrupted my forum for the second time now. First time because I didn't know about this, second time because one of the mods didn't know about this.

Anyone experienced this also, or know what is happening?
This is something I have noticed for a long time, so it's is not a recent bug or something.
My forum is pretty large with 600.000 topics.
Title: Re: Empty trashcan, random topics get deleted
Post by: Kindred on July 20, 2014, 03:42:09 PM
Never seen the before and I run a forum with 2 million posts...

What version of smf?
URL? Mods running?
Title: Re: Empty trashcan, random topics get deleted
Post by: Mr. Jinx on July 20, 2014, 04:03:10 PM
Currently I'm running 2.0.8, but this is something that I noticed about 2 years ago when I made my first mistake.
Since then, I always wait a few minutes after every delete.

In moderationlog, it shows this (when it goes wrong): Topic "" from "Trashcan" removed
There is no topic id.

1.   Sitemap   2.2.0     [ Overzicht bestanden ] [ Verwijderen ]
2.   Custom Fields on Topic   1.0     [ Deïnstalleer ] [ Overzicht bestanden ] [ Verwijderen ]
4.   Tapatalk SMF 2.0 Plugin   4.0.1     [ Deïnstalleer ] [ Overzicht bestanden ] [ Verwijderen ]
5.   Ohara YouTube Embed   1.0     [ Deïnstalleer ] [ Overzicht bestanden ] [ Verwijderen ]
6.   SMF4Mobile Mod   1.0     [ Deïnstalleer ] [ Overzicht bestanden ] [ Verwijderen ]
8.   detectBrowser Update   1.0     [ Deïnstalleer ] [ Overzicht bestanden ] [ Verwijderen ]
9.   Moderator and Administrator Comment Tags   1.8.1     [ Overzicht bestanden ] [ Verwijderen ]
11.   Bookmarks   2.3     [ Overzicht bestanden ] [ Verwijderen ]
13.   H1 Tags in link tree   1.1     [ Deïnstalleer ] [ Overzicht bestanden ] [ Verwijderen ]
15.   MCLegendII RC3   3.0     [ Deïnstalleer ] [ Overzicht bestanden ] [ Verwijderen ]
17.   Internal Links Use Same Window   1.2     [ Deïnstalleer ] [ Overzicht bestanden ] [ Verwijderen ]
19.   SMF Gallery Lite   3.6a     [ Deïnstalleer ] [ Overzicht bestanden ] [ Verwijderen ]
Title: Re: Empty trashcan, random topics get deleted
Post by: margarett on July 20, 2014, 06:46:03 PM
There has to be something cached.
Instead of waiting some minutes, can you empty your forum cache and check if the 5th page is gone?

Quote from: Mr. Jinx on July 20, 2014, 03:32:52 PM
However, if you don't know this and select all posts on page 5 again, random normal topics will be deleted!
:o

I've been looking at MessageIndex.php
QuoteIn moderationlog, it shows this (when it goes wrong): Topic "" from "Trashcan" removed
The code says:
// Only log the topic ID if it's not in the recycle board.
logAction('remove', array((empty($modSettings['recycle_enable']) || $modSettings['recycle_board'] != $removeCacheBoards[$topic] ? 'topic' : 'old_topic_id') => $topic, 'board' => $removeCacheBoards[$topic]));

So, it should be correct to not show you the topic ID. The topic *title* on the other hand, should be present...

You can debug what might be happening here with some debug code throughout MessageIndex.php but it looks quite... unique.
Title: Re: Empty trashcan, random topics get deleted
Post by: Biology Forums on July 20, 2014, 08:00:42 PM
It's a caching thing, I think. I've witnessed it too.
Title: Re: Empty trashcan, random topics get deleted
Post by: Mr. Jinx on July 21, 2014, 12:05:19 PM
Thanks for the replies. It does seem to be related to caching.

First I tried to empty the forum cache after deleting posts in the trashcan, that worked.
I also tried to disable the forum cache (using apc), and that worked also.