Page MenuHomePhabricator

Last revision is not latest revision
Open, Needs TriagePublic

Description

https://en.wikipedia.org/w/api.php?action=query&titles=Der+Untergang+des+Abendlandes&prop=info|revisions&rvdir=older&rvlimit=10&rvprop=content|ids

returns

{
  "batchcomplete": "",
  "query": {
      "pages": {
          "1549393": {
              "pageid": 1549393,
              "ns": 0,
              "title": "Der Untergang des Abendlandes",
              "contentmodel": "wikitext",
              "pagelanguage": "en",
              "touched": "2015-09-05T19:31:20Z",
              "lastrevid": 18966549,
              "length": 37,
              "redirect": "",
              "revisions": [
                  {
                      "revid": 18966563,
                      "parentid": 18966549,
                      "contentformat": "text/x-wiki",
                      "contentmodel": "wikitext",
                      "*": "#REDIRECT [[The Decline of the West]]"
                  },
                  {
                      "revid": 18966549,
                      "parentid": 17231486,
                      "contentformat": "text/x-wiki",
                      "contentmodel": "wikitext",
                      "*": "#REDIRECT [[The Decline of the West]]"
                  },
                  {
                      "revid": 17231486,
                      "parentid": 0,
                      "contentformat": "text/x-wiki",
                      "contentmodel": "wikitext",
                      "*": "#REDIRECT [[Decline of the West]]"
                  }
              ]
          }
      }
  }
}

where lastrevid is 18966549, but there is a newer revision 18966563. Is it intended or a bug?

Event Timeline

LinJin created this task.Sep 7 2015, 2:27 AM
LinJin updated the task description. (Show Details)
LinJin raised the priority of this task from to Needs Triage.
LinJin added a subscriber: LinJin.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 7 2015, 2:27 AM
Krenair added a subscriber: Krenair.
Legoktm added a subscriber: Legoktm.Sep 7 2015, 4:27 AM

I don't think this is an issue with the API, since that's what I see in the page_latest column:

MariaDB [enwiki_p]> select page_latest from page where page_id=1549393;
+-------------+
| page_latest |
+-------------+
|    18966549 |
+-------------+
1 row in set (0.01 sec)
  
MariaDB [enwiki_p]> select rev_id, rev_timestamp, rev_sha1 from revision where rev_page=1549393 order by rev_timestamp asc;
+----------+----------------+---------------------------------+
| rev_id   | rev_timestamp  | rev_sha1                        |
+----------+----------------+---------------------------------+
| 17231486 | 20050227035833 | f9vaww8a4vveph6qkbtwagztntd3ng4 |
| 18966549 | 20050716174604 | il3t5scgjv6aoashfsxtnzqlbv9lxuf |
| 18966563 | 20050716174610 | il3t5scgjv6aoashfsxtnzqlbv9lxuf |
+----------+----------------+---------------------------------+
3 rows in set (0.00 sec)

That last edit also looks fishy since the content is identical...

LinJin added a comment.EditedSep 7 2015, 5:08 AM

I see. It is not calculated when requesting.

I think there might be something wrong in pre-computing.

Could you please route it to corresponding project, which calculates the page_latest? I do not know which project it belongs to.

Krenair set Security to None.
GWicke edited subscribers, added: mobrovac, Pchelolo, GWicke; removed: Aklapper.Sep 7 2015, 3:17 PM
GWicke added a subscriber: aaron.
MariaDB [enwiki_p]> select count(*) from revision join page on (rev_page = page_id) where rev_id > page_latest;
+----------+
| count(*) |
+----------+
|      391 |
+----------+
1 row in set (1 hour 8 min 36.94 sec)
MariaDB [enwiki_p]> select max(rev_timestamp) from revision join page on (rev_page = page_id) where rev_id > page_latest group by rev_page;
+--------------------+
| max(rev_timestamp) |
+--------------------+
| 20050713153102     |
| 20050716125425     |
| 20050628124352     |
| 20050628140710     |
| 20050719095643     |
| 20050716180840     |
| 20041120020303     |
| 20050719132746     |
| 20040725074953     |
| 20050716174610     |
| 20041205022932     |
| 20050718055728     |
| 20050716191557     |
| 20050214050756     |
| 20050719160142     |
| 20050320182334     |
| 20050427031018     |
| 20041213035926     |
| 20050704195736     |
| 20050706163323     |
| 20050713232119     |
| 20050716235442     |
| 20050718042352     |
| 20070720233602     |
| 20041017063245     |
| 20050312232800     |
| 20050517045453     |
| 20060721083042     |
| 20040629222430     |
| 20050502161009     |
| 20070702134459     |
| 20020824133311     |
| 20050624193539     |
| 20050406055912     |
| 20060513184118     |
| 20070730125653     |
| 20041027104530     |
| 20070719143451     |
| 20050406064458     |
| 20050623224324     |
| 20050624115423     |
| 20041122001911     |
| 20050309055537     |
| 20070718084401     |
| 20040930155214     |
| 20070718081610     |
| 20050607011646     |
| 20041214013537     |
| 20020822220405     |
| 20070728073632     |
| 20111003033932     |
| 20050428060640     |
| 20041011213635     |
| 20070806033027     |
| 20070718075618     |
| 20070725034914     |
| 20070718075220     |
| 20070810035858     |
| 20070713142424     |
| 20070714025409     |
| 20041023022709     |
| 20070808212327     |
| 20070805035349     |
| 20070808075228     |
| 20070808114354     |
| 20070811190712     |
| 20070819080824     |
| 20070817040240     |
| 20041114224110     |
| 20020225154311     |
| 20050118185132     |
| 20020923194419     |
| 20020429121201     |
| 20041122124021     |
| 20050511173037     |
| 20040923174453     |
| 20050621192952     |
| 20050315143820     |
| 20040415182410     |
| 20041218172223     |
| 20021120003320     |
| 20040826115742     |
| 20040413184655     |
| 20040815235439     |
| 20050325081448     |
| 20050427050507     |
| 20040818230949     |
| 20050420013133     |
| 20100602205031     |
| 20041004193832     |
| 20100609232339     |
| 20100602205454     |
| 20100724003409     |
| 20050109034504     |
| 20041111215638     |
| 20041102123708     |
| 20041023093833     |
| 20040920204357     |
| 20111003025837     |
| 20050527155140     |
| 20040911134850     |
| 20041224083756     |
| 20050406194942     |
| 20040611161329     |
| 20050407214238     |
| 20040925134229     |
| 20050214210639     |
| 20120323162923     |
| 20040921131022     |
| 20050214050520     |
+--------------------+
110 rows in set (2 hours 44 min 55.74 sec)

No occurrences since 2012 on enwiki.

That last edit also looks fishy since the content is identical...

Might that be caused by a template update to the redirected page? In that case it shouldn't be strange that the SHA1 is identical, since it's a redirect. If that is true, though, why does the first revid's SHA differ?

jayvdb added a subscriber: jayvdb.Oct 14 2015, 7:30 AM
jmadler added a subscriber: jmadler.Jan 6 2016, 5:13 AM
Restricted Application added a subscriber: StudiesWorld. · View Herald TranscriptJan 6 2016, 5:13 AM

I meet the same question. The page.page_latest is not the latest revision id of a page in Tool Labs database replication. May I get the latest revision id of all pages in one operation?