Last Comment Bug 776531 - Page history is not in chronological order (DB corruption?)
: Page history is not in chronological order (DB corruption?)
Status: RESOLVED WORKSFORME
:
Product: Mozilla Developer Network
Classification: Other
Component: Editing (show other bugs)
: unspecified
: All All
: P2 normal with 1 vote (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
: 779483 891533 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-23 07:22 PDT by Jean-Yves Perrier [:teoli]
Modified: 2013-11-11 18:29 PST (History)
8 users (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Screen capture of the problem (246.32 KB, image/png)
2012-07-23 07:22 PDT, Jean-Yves Perrier [:teoli]
no flags Details
js/docs/CSS history screen shot (205.24 KB, image/png)
2012-08-08 09:02 PDT, potappo
no flags Details

Description Jean-Yves Perrier [:teoli] 2012-07-23 07:22:22 PDT
Created attachment 644925 [details]
Screen capture of the problem

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/17.0 Firefox/17.0
Build ID: 20120722030555

Steps to reproduce:

Visit: https://developer-new.mozilla.org/en-US/docs/CSS/transform-style$history


Actual results:

One entry of the history appears twice, once after newer revisions


Expected results:

Entry appears once, at the right chronological position
Comment 1 Jean-Yves Perrier [:teoli] 2012-07-23 07:27:57 PDT
I did a modification on that page.

Now the history is in chronological order, though the problematic entry is shown twice.
Comment 2 John Karahalis [:openjck] 2012-07-23 11:03:09 PDT
Confirmed that the entries are in chronoligical order now. Not sure why they were out of order before, but we should look into it.

Regarding the duplicate entries: They are actually two different edits. The second one removes the quotation marks around the number 10 near the bottom of the page.
Comment 3 Eric Shepherd [:sheppy] 2012-07-31 09:47:08 PDT
We need to include the time in the version timestamp column; the current seems to assume articles can only change once a day. I've been meaning to file a bug on that, so I will do so now.
Comment 4 Eric Shepherd [:sheppy] 2012-08-03 12:46:59 PDT
That's bug 779182 fwiw.
Comment 5 Trevor 2012-08-03 21:05:29 PDT
This seems like the same issue I was having in bug 779483,
Comment 6 John Karahalis [:openjck] 2012-08-06 09:19:47 PDT
*** Bug 779483 has been marked as a duplicate of this bug. ***
Comment 7 potappo 2012-08-08 09:02:12 PDT
Created attachment 650154 [details]
js/docs/CSS history screen shot

The following page has a similar problem, and can't be updated.

https://developer.mozilla.org/ja/docs/CSS$history
Comment 8 Jean-Yves Perrier [:teoli] 2012-08-22 08:58:59 PDT
I've seen this one more time (I think on HTML/HTML5 but I think it is fixed). I think there is a correlation (cause or effect) with a Kuma or KumaScript crash (last week or beginning of this week).
Comment 10 John Karahalis [:openjck] 2013-07-17 06:54:57 PDT
*** Bug 891533 has been marked as a duplicate of this bug. ***
Comment 11 John Karahalis [:openjck] 2013-07-17 06:56:26 PDT
Still happening (see bug 891533).

Jean-Yves also notes that this bug and bug 893210 appear at the same time, so they may be related.
Comment 12 Les Orchard [:lorchard] 2013-07-17 12:20:11 PDT
Just to be precise about this:

Looking at the screenshots, it does not seem that page history *in general* is out of chronological order. Only the revision at the top, the one considered "current" is out of order. Is that correct?

If it's just the "current revision" feature that's got a bug, that helps narrow things down.

The reason I make that distinction is that the system we inherited from SUMO / Kitsune allows for the *current revision* to not necessarily be the *most recent revision*. That's because recent revisions might not be approved for publication.

We still have that system in place, but we just auto-approve all revisions in Kuma. That system never got removed, because we may selectively re-enable it for certain sections / content zones in the future.
Comment 13 Jean-Yves Perrier [:teoli] 2013-07-18 00:26:31 PDT
(In reply to Les Orchard [:lorchard] from comment #12)

> Looking at the screenshots, it does not seem that page history *in general*
> is out of chronological order. Only the revision at the top, the one
> considered "current" is out of order. Is that correct?
> 
Most of the time, it is the top-most revision with too old and that's old. But in one case (Element's page), it is another one.

But in all case, it seems to me that only one revision is out-of-place. And the info copied from the DB in the other bug seems to indicate that it may that the last revision may not be the one approved.
Comment 14 Les Orchard [:lorchard] 2013-07-18 10:01:02 PDT
(In reply to Jean-Yves Perrier [:teoli] from comment #13)
> (In reply to Les Orchard [:lorchard] from comment #12)
>
> Most of the time, it is the top-most revision with too old and that's old.
> But in one case (Element's page), it is another one.

Which Element page - what's the URL?
Comment 15 Jean-Yves Perrier [:teoli] 2013-07-18 10:05:04 PDT
Oups, sorry: https://developer.mozilla.org/en-US/docs/Web/API/element

:-)
Comment 16 Eric Shepherd [:sheppy] 2013-09-03 10:11:52 PDT
This page started exhibiting this problem today, a few minutes ago. Can we please get it looked at quickly so we can restore it from the clipboards of the people that were working on it?

https://developer.mozilla.org/en-US/docs/Project:MDN/Style_guide$history
Comment 17 Les Orchard [:lorchard] 2013-09-04 08:03:43 PDT
(In reply to Eric Shepherd [:sheppy] from comment #16)
> This page started exhibiting this problem today, a few minutes ago. Can we
> please get it looked at quickly so we can restore it from the clipboards of
> the people that were working on it?
> 
> https://developer.mozilla.org/en-US/docs/Project:MDN/Style_guide$history

Looks like this particular issue is fixed now. Is this bug still a drop everything until its fixed blocker?
Comment 18 Eric Shepherd [:sheppy] 2013-09-04 08:05:00 PDT
(In reply to Les Orchard [:lorchard] from comment #17)
> (In reply to Eric Shepherd [:sheppy] from comment #16)
> > This page started exhibiting this problem today, a few minutes ago. Can we
> > please get it looked at quickly so we can restore it from the clipboards of
> > the people that were working on it?
> > 
> > https://developer.mozilla.org/en-US/docs/Project:MDN/Style_guide$history
> 
> Looks like this particular issue is fixed now. Is this bug still a drop
> everything until its fixed blocker?

No, but it needs to be kept on the front burner as best as possible, because the writers are all really worried that this continues to be a symptom of a larger underlying problem, and every time it happens, we panic a little.
Comment 19 John Karahalis [:openjck] 2013-09-04 09:19:37 PDT
Stephen, Raymond: Having trouble reproducing this. Would either of you be able to find some STR?
Comment 20 Les Orchard [:lorchard] 2013-09-09 10:07:22 PDT
Still trying to reproduce & find a cause for this bug after a few days. For what it's worth, it looks like there are 8 pages currently affected:

mysql> SELECT wd.id, wd.locale, wd.slug, MAX(wr.id) AS max_revision_id, wd.current_revision_id, wd.modified
    -> FROM wiki_document wd, wiki_revision wr
    -> WHERE wd.id = wr.document_id
    -> GROUP BY wd.id HAVING max_revision_id > wd.current_revision_id and
    ->     wd.modified > '2012-06'
    -> ORDER BY wd.modified;
+-------+--------+------------------------------------------------+-----------------+---------------------+---------------------+
| id    | locale | slug                                           | max_revision_id | current_revision_id | modified            |
+-------+--------+------------------------------------------------+-----------------+---------------------+---------------------+
|  6104 | ja     | Tools/Web_Console/Helpers                      |          457933 |              457931 | 2013-09-03 09:36:56 |
| 18120 | fr     | CSS/longueur                                   |          461945 |              451869 | 2013-09-03 09:46:18 |
| 33003 | fr     | CSS/font-style                                 |          462911 |              448457 | 2013-09-03 09:55:05 |
| 74911 | en-US  | Tools_Toolbox                                  |          442413 |              442389 | 2013-09-03 10:11:09 |
| 60763 | en-US  | Project:MDN                                    |          463345 |              442077 | 2013-09-03 10:11:17 |
| 65727 | en-US  | User:Mark_Giffin/subpage_B/subpage_A           |          446355 |              379615 | 2013-09-03 13:46:48 |
| 15976 | fr     | Guide_du_d�veloppeur_d'extensions_pour_Firefox |          450211 |              274432 | 2013-09-03 17:21:26 |
| 55753 | en-US  | WebAPI                                         |          463775 |              453261 | 2013-09-04 03:07:18 |
+-------+--------+------------------------------------------------+-----------------+---------------------+---------------------+
8 rows in set, 1 warning (0.68 sec)

I have a script to fix those, and will do so shortly after getting a copy of the DB for further investigation. But, this fix doesn't fix what caused them to get into this state in the first place.
Comment 21 Les Orchard [:lorchard] 2013-09-09 10:23:17 PDT
Got a DB snapshot, ran the repair script, currently 0 docs affected by this bug as I understand it.

So, if there's any known page still in a state where history looks out of order - comment on this bug. Because, that might mean I don't understand the bug.
Comment 22 raymond [:retornam] (needinfo? me) 2013-09-17 13:35:12 PDT
I haven't been able to reproduce this.
Comment 23 John Karahalis [:openjck] 2013-09-24 13:45:02 PDT
Based on comment 20, comment 21, and comment 22 I am going to mark this as WORKSFORME. Please reopen if you experience this issue again.

Note You need to log in before you can comment on or make changes to this bug.