What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 134 Stack Exchange communities.

Sometimes, when a question gets deleted, not all answers of that question get automatically deleted too. Provided that you can see the deleted question, those answers can still be voted on/..., just like normal answers. This is inconsistent and should be prevented.

Most of the examples seem to fall into two categories:

Questions deleted for being spam/by moderators (just a guess, those questions have no "deleted by" and no record of their deletion in their revision history. Probably that's a bug on it's own):

However those questions got deleted, this action should probably also delete the answers to that question.

Race conditions:

I would guess the reason for this is some side effect of the "can still post answer after question is closed" grace period (I seem to remember there was such a thing). This grace window should not apply to deleted questions or the posted answers should immediately be marked deleted.

In the latest data dump there were all together >4000 such "undead" answers. To find them the following query can be used:

select
  a_parentid  as "question id",
  count(a_id) as "number of not deleted answers"
from (
  select
    answers.id       as a_id,
    answers.parentid as a_parentid,
    questions.id     as q_id
  from
    posts as answers left outer join posts as questions
      on answers.parentid = questions.id
  where
    answers.posttypeid = 2
) as subquery
where q_id is NULL
group by a_parentid;

(The query for the real database would probably be simpler since there it should be possible to directly ask if a given question is deleted)

share|improve this question
11  
Does anyone else feel like the zombie tag is appropriate here? ;) –  gnostradamus Jan 6 '10 at 20:49
1  
It looks to me that the first set of questions are ones where the person who asked the question was deleted, not the question itself. –  Paul Tomblin Jan 6 '10 at 20:57
    
I would guess that the first 4 questions were also deleted by the question owners, and the subsequent deletion of their account caused their names to be removed from the "deleted by" line. Questions deleted due to spam or offensive flags usually list "deleted by Community" (example here: stackoverflow.com/questions/2007773/…). –  gnostradamus Jan 6 '10 at 21:04
    
I don't think the question owners could have deleted the questions, some of them have quite highly voted answers. If the deleted questions are just a side effect of deleting the users, maybe that's already an error. Some of the questions don't seem to be that bad. –  sth Jan 6 '10 at 21:10
    
See also: meta.stackexchange.com/questions/19208/… (different problem, but likely due to the same underlying grace periods) –  Shogging through the snow Jan 6 '10 at 22:16

1 Answer 1

up vote 10 down vote accepted

As part of our standard hourly process, we now force all answers of deleted questions to be deleted.

Bear in mind that there are still restrictions on whether or not the question owner can delete their question (and implicitly all of the answers) depending on

  • how many answers there are
  • how many upvotes the answers have

In general if a question has low/no answers it can be instantly deleted by the owner, as it doesn't affect other users.

Good news! No more zombie answers out there, clogging up the works. I imagine them looking a bit like this:

share|improve this answer
2  
*flags as offensive/disgusting –  Earlz May 16 '10 at 9:47
4  
and just for old time's sake sth here you go tejp.de/files/so/saturday.jpeg (although this is a weird combo of pegasus / unicorn now that I look at it..) –  Jeff Atwood May 16 '10 at 9:47
    
+1: Zombie unicorns rule! Or at least eat the brains of anyone who dares to say they don't. –  Donal Fellows May 16 '10 at 21:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .