S8 replication issues leading to rows missing during eqiad -> codfw switch (Was: "A few lexemes disappeared")
Closed, ResolvedPublic

Description

I noticed strange thing. Lexemes from L20540 to L20543 just disappeared. They were neither merged, nor deleted. They for sure existed because they were created by me and I document every Polish lexeme I created on this page. As far as I remember they were created 13 September (after datacenter switch) and they disappeared 10/11 October (after datacenter switch back)‎. Could it be that this is related to https://wikitech.wikimedia.org/wiki/Switch_Datacenter#Schedule_for_2018_switch ?

DBAs updates:

Action plan: T206743#4658146
Missing rows timeline: T206743#4658274
Cloning hosts progress: T206743#4658362
The only section affected was s8 - T206743#4665589
All pooled replicas are now fixed - T206743#4666493
Al tables on s8 master (db1071) fixed (apart from pagelinks and wb_terms which are in progress): T206743#4673983
All core hosts fixed: T206743#4677827ç
Second round of checks: T206743#4685983 T206743#4687946
Third round of big tables done, only pending wb_terms: T206743#4688580
Empty tables that need no checking: T206743#4690844
All tables checked and confirmed consistent: T206743#4691048

There are a very large number of changes, so older changes are hidden. Show Older Changes
Addshore added a comment.EditedOct 12 2018, 5:49 PM

Here is a list of all pages that will likely be affected already with data being lost in the revisions that have since been restored:

MariaDB [wikidatawiki]>  SELECT DISTINCT rev_page, page_title, page_namespace, page_touched
    -> FROM revision AS revision
    -> INNER JOIN page AS page ON revision.rev_page = page.page_id
    -> WHERE rev_id > 745452473 and rev_id < 745468910 and page_touched > 20181010151500
    -> ORDER BY page_namespace, page_title;
+----------+---------------------------------------------------------------------------------+----------------+----------------+
| rev_page | page_title                                                                      | page_namespace | page_touched   |
+----------+---------------------------------------------------------------------------------+----------------+----------------+
|   957791 | Q1008351                                                                        |              0 | 20181011183506 |
|   972072 | Q1022718                                                                        |              0 | 20181011112403 |
| 11573912 | Q10269330                                                                       |              0 | 20181011102631 |
| 11618130 | Q10313336                                                                       |              0 | 20181011183306 |
| 12075277 | Q10801324                                                                       |              0 | 20181011231428 |
|  1037514 | Q1089690                                                                        |              0 | 20181011224900 |
|   115186 | Q112562                                                                         |              0 | 20181011232641 |
|  1072735 | Q1125675                                                                        |              0 | 20181011112401 |
|  1088182 | Q1141499                                                                        |              0 | 20181011093245 |
|  1098210 | Q1151801                                                                        |              0 | 20181011112357 |
|  1103257 | Q1156971                                                                        |              0 | 20181011231351 |
|  1140371 | Q1196895                                                                        |              0 | 20181011150707 |
|   130504 | Q128504                                                                         |              0 | 20181012061613 |
|  1246692 | Q1306726                                                                        |              0 | 20181012061648 |
|  1278081 | Q1338401                                                                        |              0 | 20181011010159 |
|  1304828 | Q1365309                                                                        |              0 | 20181011112351 |
|   140372 | Q138671                                                                         |              0 | 20181012114338 |
|   140517 | Q138820                                                                         |              0 | 20181011032316 |
|  1373695 | Q1435223                                                                        |              0 | 20181011093244 |
|  1444721 | Q1507379                                                                        |              0 | 20181011112349 |
| 17026621 | Q15378860                                                                       |              0 | 20181011195823 |
|  1480008 | Q1543446                                                                        |              0 | 20181011112346 |
| 17087585 | Q15443105                                                                       |              0 | 20181011112023 |
| 17343834 | Q15708744                                                                       |              0 | 20181012023419 |
| 17825650 | Q16199113                                                                       |              0 | 20181010184808 |
| 17865127 | Q16240975                                                                       |              0 | 20181012124819 |
|  1575620 | Q1641483                                                                        |              0 | 20181011112343 |
|  1607340 | Q1673849                                                                        |              0 | 20181011200423 |
|   168071 | Q167548                                                                         |              0 | 20181011112132 |
|  1611743 | Q1678281                                                                        |              0 | 20181011112340 |
|  1616952 | Q1683527                                                                        |              0 | 20181011102520 |
|  1624134 | Q1690779                                                                        |              0 | 20181011112338 |
|  1688234 | Q1755568                                                                        |              0 | 20181011093246 |
|  1694424 | Q1762011                                                                        |              0 | 20181012035631 |
|  1742299 | Q1811132                                                                        |              0 | 20181011112335 |
|  1754506 | Q1823744                                                                        |              0 | 20181012013950 |
| 19862904 | Q18333329                                                                       |              0 | 20181011215652 |
| 21738062 | Q20068036                                                                       |              0 | 20181011193532 |
|   198920 | Q202335                                                                         |              0 | 20181010175433 |
|   201044 | Q204673                                                                         |              0 | 20181011185857 |
|  1978761 | Q2051265                                                                        |              0 | 20181011231931 |
|  1985680 | Q2058295                                                                        |              0 | 20181012161641 |
|   203131 | Q206901                                                                         |              0 | 20181011112444 |
| 22459166 | Q20713246                                                                       |              0 | 20181010204958 |
|  2008976 | Q2081964                                                                        |              0 | 20181010212249 |
|  2086134 | Q2160802                                                                        |              0 | 20181011112332 |
| 23687338 | Q21646756                                                                       |              0 | 20181012000520 |
|   228686 | Q235159                                                                         |              0 | 20181011183455 |
|  2309304 | Q2390402                                                                        |              0 | 20181011184222 |
|   247770 | Q255314                                                                         |              0 | 20181011214756 |
|   260198 | Q268667                                                                         |              0 | 20181011112439 |
|   261193 | Q269762                                                                         |              0 | 20181011104759 |
| 29148268 | Q27343176                                                                       |              0 | 20181010183633 |
|  2787662 | Q2912561                                                                        |              0 | 20181011205402 |
|  2874057 | Q3006047                                                                        |              0 | 20181012095825 |
|  2878421 | Q3010685                                                                        |              0 | 20181010185630 |
|  2985601 | Q3124666                                                                        |              0 | 20181011051530 |
|  3004470 | Q3144934                                                                        |              0 | 20181011112325 |
|   307820 | Q320431                                                                         |              0 | 20181011184537 |
|  3178480 | Q3333971                                                                        |              0 | 20181011173248 |
| 35007772 | Q33561533                                                                       |              0 | 20181011213159 |
| 35023180 | Q33577088                                                                       |              0 | 20181012011441 |
| 35701956 | Q34262237                                                                       |              0 | 20181011151904 |
| 35702184 | Q34262466                                                                       |              0 | 20181010223222 |
| 35702622 | Q34262904                                                                       |              0 | 20181010163705 |
| 35702988 | Q34263275                                                                       |              0 | 20181012094550 |
| 35703059 | Q34263346                                                                       |              0 | 20181012092118 |
| 35703076 | Q34263363                                                                       |              0 | 20181012092012 |
| 35703083 | Q34263370                                                                       |              0 | 20181012091926 |
|  3265334 | Q3427374                                                                        |              0 | 20181011013745 |
|  3341159 | Q3508800                                                                        |              0 | 20181011112321 |
| 38392418 | Q37012398                                                                       |              0 | 20181011084656 |
|  3535241 | Q3709312                                                                        |              0 | 20181011112318 |
| 38685156 | Q37308652                                                                       |              0 | 20181011094801 |
| 39033395 | Q37660398                                                                       |              0 | 20181011162706 |
| 39447871 | Q38079893                                                                       |              0 | 20181011221000 |
| 39485756 | Q38117928                                                                       |              0 | 20181011224245 |
|  3647964 | Q3824771                                                                        |              0 | 20181012012959 |
| 39730811 | Q38365229                                                                       |              0 | 20181012023936 |
| 40029265 | Q38667098                                                                       |              0 | 20181010200901 |
|   369686 | Q388501                                                                         |              0 | 20181011021133 |
|  3716366 | Q3894917                                                                        |              0 | 20181012020308 |
| 40394048 | Q39035187                                                                       |              0 | 20181012085635 |
| 40543701 | Q39186183                                                                       |              0 | 20181011183820 |
| 41255425 | Q39907647                                                                       |              0 | 20181012080721 |
| 41256342 | Q39908575                                                                       |              0 | 20181010175007 |
| 41256501 | Q39908733                                                                       |              0 | 20181011060643 |
| 41256513 | Q39908746                                                                       |              0 | 20181012093612 |
| 41257665 | Q39909915                                                                       |              0 | 20181011060656 |
| 41258848 | Q39911150                                                                       |              0 | 20181010235101 |
| 41260860 | Q39913204                                                                       |              0 | 20181011060757 |
| 41261082 | Q39913428                                                                       |              0 | 20181012102913 |
| 41261094 | Q39913440                                                                       |              0 | 20181012102934 |
| 41261858 | Q39914222                                                                       |              0 | 20181011224648 |
| 41262356 | Q39914725                                                                       |              0 | 20181012085955 |
| 41262787 | Q39915160                                                                       |              0 | 20181012080327 |
| 41263307 | Q39915689                                                                       |              0 | 20181012084816 |
|   384336 | Q405379                                                                         |              0 | 20181011202102 |
|   391982 | Q413914                                                                         |              0 | 20181010165906 |
| 43253714 | Q41948972                                                                       |              0 | 20181010153910 |
| 43254325 | Q41949634                                                                       |              0 | 20181010153550 |
| 43255162 | Q41950534                                                                       |              0 | 20181010153134 |
| 43256202 | Q41951622                                                                       |              0 | 20181010152708 |
| 43256997 | Q41952471                                                                       |              0 | 20181010152137 |
| 43368415 | Q42070996                                                                       |              0 | 20181011102602 |
| 43368817 | Q42071422                                                                       |              0 | 20181010164110 |
| 43368881 | Q42071490                                                                       |              0 | 20181010190808 |
| 43369101 | Q42071724                                                                       |              0 | 20181012062007 |
|  4082894 | Q4271978                                                                        |              0 | 20181011222138 |
|  4163798 | Q4358039                                                                        |              0 | 20181011112310 |
|  4223095 | Q4421817                                                                        |              0 | 20181012023856 |
|   422669 | Q447991                                                                         |              0 | 20181011013552 |
| 46076673 | Q44893536                                                                       |              0 | 20181011140903 |
| 47320704 | Q46181491                                                                       |              0 | 20181012054623 |
|   435627 | Q461854                                                                         |              0 | 20181011112426 |
|  4447927 | Q4656032                                                                        |              0 | 20181012064814 |
|   451387 | Q478944                                                                         |              0 | 20181011185815 |
| 49061308 | Q48029208                                                                       |              0 | 20181012145415 |
| 49299836 | Q48270808                                                                       |              0 | 20181011115725 |
|    50446 | Q48460                                                                          |              0 | 20181012133354 |
| 50543043 | Q49540506                                                                       |              0 | 20181012010223 |
| 50563374 | Q49560992                                                                       |              0 | 20181012010332 |
| 50566855 | Q49564504                                                                       |              0 | 20181012014956 |
| 50575127 | Q49572856                                                                       |              0 | 20181012010949 |
| 50624954 | Q49623071                                                                       |              0 | 20181010213220 |
| 50739022 | Q49737482                                                                       |              0 | 20181010163039 |
| 50942082 | Q49942384                                                                       |              0 | 20181011061213 |
| 51073050 | Q50075052                                                                       |              0 | 20181011152312 |
|   477133 | Q507443                                                                         |              0 | 20181011215739 |
|   477184 | Q507495                                                                         |              0 | 20181011110342 |
|  4914180 | Q5141749                                                                        |              0 | 20181010154817 |
| 52372133 | Q51455231                                                                       |              0 | 20181011052134 |
|  4933784 | Q5162259                                                                        |              0 | 20181011173232 |
| 52740327 | Q51829353                                                                       |              0 | 20181011052204 |
|  5069396 | Q5300847                                                                        |              0 | 20181010153853 |
| 53882540 | Q53218157                                                                       |              0 | 20181012072049 |
| 53937530 | Q53329314                                                                       |              0 | 20181012131354 |
| 54158274 | Q53657221                                                                       |              0 | 20181011112928 |
| 54165977 | Q53666308                                                                       |              0 | 20181012135045 |
| 54742546 | Q54558402                                                                       |              0 | 20181012163918 |
|   514688 | Q546323                                                                         |              0 | 20181012171751 |
| 55418980 | Q55391507                                                                       |              0 | 20181012043021 |
| 55421379 | Q55393994                                                                       |              0 | 20181012045043 |
| 56000140 | Q56051896                                                                       |              0 | 20181011174443 |
|  5369329 | Q5608478                                                                        |              0 | 20181010165855 |
| 56159982 | Q56217568                                                                       |              0 | 20181011055628 |
| 56161030 | Q56218619                                                                       |              0 | 20181011055657 |
| 56161856 | Q56219453                                                                       |              0 | 20181011055734 |
|  5392274 | Q5631147                                                                        |              0 | 20181011102625 |
| 56437871 | Q56499153                                                                       |              0 | 20181011001139 |
| 56543532 | Q56604343                                                                       |              0 | 20181012050653 |
| 56543610 | Q56604417                                                                       |              0 | 20181011181951 |
| 56543615 | Q56604422                                                                       |              0 | 20181011181908 |
| 56543617 | Q56604423                                                                       |              0 | 20181011215538 |
| 56543619 | Q56604425                                                                       |              0 | 20181011181825 |
| 56543623 | Q56604431                                                                       |              0 | 20181011175741 |
|    60222 | Q57402                                                                          |              0 | 20181012171131 |
|   618860 | Q657516                                                                         |              0 | 20181011112421 |
|   636327 | Q675547                                                                         |              0 | 20181011081337 |
|  6612593 | Q6766645                                                                        |              0 | 20181010153854 |
|  6655901 | Q6805941                                                                        |              0 | 20181011083505 |
|   659769 | Q701108                                                                         |              0 | 20181011202837 |
|  6919619 | Q7034101                                                                        |              0 | 20181012063018 |
|  7226804 | Q7320761                                                                        |              0 | 20181011112220 |
|  7232144 | Q7325915                                                                        |              0 | 20181010184809 |
|  7494149 | Q7575800                                                                        |              0 | 20181010154117 |
|   712640 | Q757749                                                                         |              0 | 20181011112409 |
|  7734782 | Q7803282                                                                        |              0 | 20181010153855 |
|  7843764 | Q7905827                                                                        |              0 | 20181010183135 |
|   743985 | Q790971                                                                         |              0 | 20181011112406 |
|   797838 | Q845779                                                                         |              0 | 20181011093248 |
|   920104 | Q970408                                                                         |              0 | 20181011034629 |
|   947009 | Q997456                                                                         |              0 | 20181010165844 |
| 24932878 | Gz260/Roads/E/Wikidata/nl                                                       |              2 | 20181012051044 |
| 56496542 | Jacksonj04/Leeds/Prompt/All/comparison                                          |              2 | 20181012090943 |
| 56496550 | Jacksonj04/Leeds/Prompt/All/comparison_csv                                      |              2 | 20181012090944 |
| 48530520 | Jacksonj04/prompts/Kenya/Assembly/comparison                                    |              2 | 20181011090730 |
| 48530527 | Jacksonj04/prompts/Kenya/Assembly/comparison_csv                                |              2 | 20181011090733 |
| 48530519 | Jacksonj04/prompts/Kenya/Assembly/stats                                         |              2 | 20181011090730 |
| 51458078 | Jacksonj04/prompts/Pakistan/Assembly/Official/comparison                        |              2 | 20181012090848 |
| 51458087 | Jacksonj04/prompts/Pakistan/Assembly/Official/comparison_csv                    |              2 | 20181012090851 |
| 51458075 | Jacksonj04/prompts/Pakistan/Assembly/Official/stats                             |              2 | 20181011090912 |
| 49657071 | Jacksonj04/prompts/South_Africa/Assembly/Official/comparison                    |              2 | 20181012090817 |
| 49657081 | Jacksonj04/prompts/South_Africa/Assembly/Official/comparison_csv                |              2 | 20181012090820 |
| 49657067 | Jacksonj04/prompts/South_Africa/Assembly/Official/stats                         |              2 | 20181011090801 |
| 56304527 | KaMan/WSJP                                                                      |              2 | 20181011115159 |
| 55022675 | KaMan/brudnopis                                                                 |              2 | 20181012055348 |
| 30487411 | Máté/ratings/Academy_Awards                                                     |              2 | 20181012154749 |
| 55072711 | Nurni/Painting_candidates                                                       |              2 | 20181012154311 |
| 31726906 | Olaf_Kosinsky/Chile                                                             |              2 | 20181012160214 |
| 25693096 | Olaf_Kosinsky/Reichstag_Kaiserreich                                             |              2 | 20181011223129 |
| 29058208 | Olaf_Kosinsky/USA_Michigan                                                      |              2 | 20181012110330 |
| 25722124 | Olaf_Kosinsky/USA_Repräsentantenhaus_Republikanische_Partei                     |              2 | 20181012083236 |
| 56425624 | Oravrattas/prompts/8th_European_Parliament/comparison                           |              2 | 20181012090934 |
| 56425631 | Oravrattas/prompts/8th_European_Parliament/comparison_csv                       |              2 | 20181012090936 |
| 31749200 | Pawel_Marynowski_(WMIE)/Tables/Cork                                             |              2 | 20181012055504 |
| 25772493 | SR5/P/500                                                                       |              2 | 20181011170317 |
| 26230380 | SR5/Test/1                                                                      |              2 | 20181012034000 |
| 44150090 | Strakhov/PRUEBA001                                                              |              2 | 20181011232408 |
| 22492864 | Máté                                                                            |              3 | 20181012043735 |
| 23684710 | Database_reports/Identical_GND_ID                                               |              4 | 20181012171500 |
| 23537613 | Database_reports/Identical_VIAF_ID                                              |              4 | 20181012152525 |
| 23020581 | Database_reports/identical_birth_and_death_dates                                |              4 | 20181012153356 |
| 23020610 | Database_reports/identical_birth_and_death_dates/1                              |              4 | 20181012153356 |
| 29585021 | Flemish_art_collections,_Wikidata_and_Linked_Open_Data/KMSKA/Creators           |              4 | 20181011225425 |
| 31621196 | Met_Open_Access_Artworks_Challenge/ES                                           |              4 | 20181012082724 |
| 31591206 | Met_Open_Access_Artworks_Challenge/IT                                           |              4 | 20181012110503 |
| 31591177 | Met_Open_Access_Artworks_Challenge/RU                                           |              4 | 20181012084303 |
| 56400232 | Property_proposal/ArhivX_LOD                                                    |              4 | 20181012004639 |
| 56540384 | Property_proposal/Arkivportalen_aktor_ID                                        |              4 | 20181012004639 |
| 56540714 | Property_proposal/Arkivportalen_arkiv_ID                                        |              4 | 20181012004639 |
| 56538430 | Property_proposal/CharacTour_character_ID                                       |              4 | 20181011151733 |
| 56538037 | Property_proposal/Microsoft_Store_app_ID                                        |              4 | 20181012004639 |
| 56525183 | Property_proposal/Model_item_for                                                |              4 | 20181012043735 |
| 56543524 | Property_proposal/Muziekweb_performer_ID                                        |              4 | 20181012004639 |
| 21420181 | Property_proposal/count                                                         |              4 | 20181012145129 |
| 56539145 | Property_proposal/re3data_repository_ID                                         |              4 | 20181011005059 |
| 55786984 | Property_proposal/value_is_inherited_from                                       |              4 | 20181011115053 |
|      454 | Requests_for_deletions                                                          |              4 | 20181012172057 |
| 48119148 | WikiProject_France/Églises/28                                                   |              4 | 20181011054657 |
| 33246637 | WikiProject_Heads_of_state_and_government/Report:P1313/P1365                    |              4 | 20181011102947 |
| 31671457 | WikiProject_Maps/list_of_maps/RDT                                               |              4 | 20181012050334 |
| 23793929 | WikiProject_Movies/Numbers/Most_frequent_P144                                   |              4 | 20181011161304 |
| 29634655 | WikiProject_Movies/lists/multiple_language_versions/it                          |              4 | 20181012013210 |
| 29753336 | WikiProject_Names/lists/Arabic_given_names                                      |              4 | 20181012115818 |
| 28114772 | WikiProject_Names/reports/Romans_with_P2358                                     |              4 | 20181012172236 |
| 27869767 | WikiProject_Q5/lists/people_who_died_on_their_birthday                          |              4 | 20181012002603 |
| 56302855 | WikiProject_Source_MetaData/Wikidata_lists/Usage_of_Template_Scholia/Cross-wiki |              4 | 20181012171837 |
| 51320106 | WikiProject_every_politician/France/data/Assembly/15th_(bio)                    |              4 | 20181012051832 |
| 46908531 | WikiProject_every_politician/Italy/Deputies/prompts/OpenPolis/comparison        |              4 | 20181012090637 |
| 46908539 | WikiProject_every_politician/Italy/Deputies/prompts/OpenPolis/comparison_csv    |              4 | 20181012090640 |
| 28386517 | WikiProject_sum_of_all_paintings/Collections_without_inventory_number           |              4 | 20181012033856 |
| 52365903 | WikiProject_sum_of_all_paintings/Location/Armenia/Missing_inventory_number      |              4 | 20181012125721 |
| 16175375 | Lexicographical_data                                                            |              5 | 20181011184712 |
| 26029028 | Import_NBD_from_enwikisource/lists/people                                       |             12 | 20181012052722 |
| 15088705 | P580                                                                            |            120 | 20181011081153 |
| 15088708 | P582                                                                            |            120 | 20181011081212 |
| 27795330 | P2963                                                                           |            121 | 20181012002041 |
| 27871509 | P2969                                                                           |            121 | 20181012002041 |
| 30231096 | P3533                                                                           |            121 | 20181012002041 |
| 30487540 | P3685                                                                           |            121 | 20181012002041 |
| 31528508 | P3936                                                                           |            121 | 20181012002042 |
| 31856026 | P4050                                                                           |            121 | 20181012002042 |
| 56058928 | P5633                                                                           |            121 | 20181012002042 |
| 56058926 | P5634                                                                           |            121 | 20181012002042 |
| 56215320 | P5721                                                                           |            121 | 20181012002042 |
| 56218329 | P5724                                                                           |            121 | 20181012002042 |
| 56543616 | L20543                                                                          |            146 | 20181011163148 |
+----------+---------------------------------------------------------------------------------+----------------+----------------+
248 rows in set (0.05 sec)

It looks like in total there were 9681 pages linked to the revisions that had to be restored that could be affected:

MariaDB [wikidatawiki]> select count(DISTINCT rev_page) from revision where rev_id > 745452473 and rev_id < 745468910;
+--------------------------+
| count(DISTINCT rev_page) |
+--------------------------+
|                     9681 |
+--------------------------+
1 row in set (0.02 sec)

Which means there are ~9433 pages that now probably have the wrong page_latest, for example:

MariaDB [wikidatawiki]> select page_id, page_title, page_latest from page where page_id = 99480;
+---------+------------+-------------+
| page_id | page_title | page_latest |
+---------+------------+-------------+
|   99480 | Q97215     |   737776142 |
+---------+------------+-------------+
1 row in set (0.00 sec)

MariaDB [wikidatawiki]> select rev_id from revision where rev_page = 99480 order by rev_id desc limit 2;
+-----------+
| rev_id    |
+-----------+
| 745463455 |
| 737776142 |
+-----------+
2 rows in set (0.00 sec)

These pages can be found with the following query:

SELECT DISTINCT rev_page, page_title, page_namespace, page_touched
FROM revision AS revision
INNER JOIN page AS page ON revision.rev_page = page.page_id
WHERE rev_id > 745452473 and rev_id < 745468910 and page_touched < 20181010151500
ORDER BY page_namespace, page_title;

It looks like we could fix these with the attachLatest.php maint script but it would need a little bit of modification.

We are also fully restoring the eqiad hosts from codfw which has all the fine data.
The fix done on Friday was a quick fix to get all the data in there.

On eqiad, db1099 and db1101 should already have the proper data. They were recloned from codfw

Which means there are ~9433 pages that now probably have the wrong page_latest, for example:

We are fixing that by recloning the hosts (T206743#4658362) from codfw, which have the correct data:
See how db1099 and db1101 already have the good data.

root@neodymium:/home/marostegui# ./section s8 | while read host port; do echo $host; mysql.py -h$host:$port wikidatawiki -BN -e "select page_id, page_title, page_latest from page where page_id = 99480;";done
labsdb1011.eqiad.wmnet
99480	Q97215	737776142
labsdb1010.eqiad.wmnet
99480	Q97215	737776142
labsdb1009.eqiad.wmnet
99480	Q97215	737776142
dbstore2001.codfw.wmnet
99480	Q97215	745463455
dbstore1002.eqiad.wmnet
99480	Q97215	737776142
db2094.codfw.wmnet
99480	Q97215	745463455
db2086.codfw.wmnet
99480	Q97215	745463455
db2085.codfw.wmnet
99480	Q97215	745463455
db2083.codfw.wmnet
99480	Q97215	745463455
db2082.codfw.wmnet
99480	Q97215	745463455
db2081.codfw.wmnet
99480	Q97215	745463455
db2080.codfw.wmnet
99480	Q97215	745463455
db2079.codfw.wmnet
99480	Q97215	745463455
db2045.codfw.wmnet
99480	Q97215	745463455
db1124.eqiad.wmnet
99480	Q97215	737776142
db1116.eqiad.wmnet
99480	Q97215	745463455
db1109.eqiad.wmnet
99480	Q97215	737776142
db1104.eqiad.wmnet
99480	Q97215	737776142
db1101.eqiad.wmnet
99480	Q97215	745463455
db1099.eqiad.wmnet
99480	Q97215	745463455
db1092.eqiad.wmnet
99480	Q97215	737776142
db1087.eqiad.wmnet
99480	Q97215	737776142
db1071.eqiad.wmnet
99480	Q97215	737776142

The idea with the quick was to get some rows in place, rather than have no rows.

I'll run a maint script to fix the page_latest of the 9000ish pages that have an incorrect one so that we don't end up with more inconsistencies / broken stuff moving forward.

Mentioned in SAL (#wikimedia-operations) [2018-10-12T18:25:26Z] <addshore> running modified attachLatest.php script over ~9000 pages on wikidatawiki (with added wait for slaves) T206743

I'll run a maint script to fix the page_latest of the 9000ish pages that have an incorrect one so that we don't end up with more inconsistencies / broken stuff moving forward.

But what will happen with the correct data we have in codfw??

I'll run a maint script to fix the page_latest of the 9000ish pages that have an incorrect one so that we don't end up with more inconsistencies / broken stuff moving forward.

But what will happen with the correct data we have in codfw??

Well after the script run both DCs should be correct.

Essentially what has happened is:

  • Switch from codfw to eqiad, resulting in the missing transactions
  • One of the pages that had missing updates was edited during that time, making a new revision (with a newer rev id) and bumping the page_latest
  • When we then added the transactions back, the previous updates to the page table changes the page_latest back to an ID prior to what is currently the latest.

Once the script has finished the fallout of this whole thing should be that there are some inconsistencies with the pages / history for the pages listed in T206743#4661906 which were edited during this odd time between the switch back to eqiad and the adding of these revisions / running of this script.

Mentioned in SAL (#wikimedia-operations) [2018-10-12T18:37:06Z] <addshore> modified attachLatest.php script finished running over 9395 pages T206743

Using the example that I had in T206743#4661943 the pages that were fixable should now be fixed

MariaDB [wikidatawiki]> select page_id, page_title, page_latest from page where page_id = 99480;
+---------+------------+-------------+
| page_id | page_title | page_latest |
+---------+------------+-------------+
|   99480 | Q97215     |   745463455 |
+---------+------------+-------------+
1 row in set (0.00 sec)

MariaDB [wikidatawiki]> select rev_id from revision where rev_page = 99480 order by rev_id desc limit 2;
+-----------+
| rev_id    |
+-----------+
| 745463455 |
| 737776142 |
+-----------+
2 rows in set (0.00 sec)

@Marostegui I guess you could confirm that using the powers you demonstrated in T206743#4662022 ? :)

root@neodymium:/home/marostegui# ./section s8 | while read host port; do echo $host; mysql.py -h$host:$port wikidatawiki -BN -e "select page_id, page_title, page_latest from page where page_id = 99480;";done
labsdb1011.eqiad.wmnet
99480	Q97215	745463455
labsdb1010.eqiad.wmnet
99480	Q97215	745463455
labsdb1009.eqiad.wmnet
99480	Q97215	745463455
dbstore2001.codfw.wmnet
99480	Q97215	745463455
dbstore1002.eqiad.wmnet
99480	Q97215	745463455
db2094.codfw.wmnet
99480	Q97215	745463455
db2086.codfw.wmnet
99480	Q97215	745463455
db2085.codfw.wmnet
99480	Q97215	745463455
db2083.codfw.wmnet
99480	Q97215	745463455
db2082.codfw.wmnet
99480	Q97215	745463455
db2081.codfw.wmnet
99480	Q97215	745463455
db2080.codfw.wmnet
99480	Q97215	745463455
db2079.codfw.wmnet
99480	Q97215	745463455
db2045.codfw.wmnet
99480	Q97215	745463455
db1124.eqiad.wmnet
99480	Q97215	745463455
db1116.eqiad.wmnet
99480	Q97215	745463455
db1109.eqiad.wmnet
99480	Q97215	745463455
db1104.eqiad.wmnet
99480	Q97215	745463455
db1101.eqiad.wmnet
99480	Q97215	745463455
db1099.eqiad.wmnet
99480	Q97215	745463455
db1092.eqiad.wmnet
99480	Q97215	745463455
db1087.eqiad.wmnet
99480	Q97215	745463455
db1071.eqiad.wmnet
99480	Q97215	745463455
Marostegui moved this task from Triage to In progress on the DBA board.Oct 13 2018, 7:46 AM

The item I gave as an example above still shows the wrong image:

https://www.wikidata.org/wiki/Q2058295

It is also missing other data. Note this diff, the most recent edit (as I write):

https://www.wikidata.org/w/index.php?title=Q2058295&diff=762891812&oldid=745457545

as it was made with Mix'n'Match, only one ID should have been added.

Change 467249 had a related patch set uploaded (by Marostegui; owner: Marostegui):
[operations/mediawiki-config@master] db-eqiad.php: Depool db1109

https://gerrit.wikimedia.org/r/467249

Change 467249 merged by jenkins-bot:
[operations/mediawiki-config@master] db-eqiad.php: Depool db1109

https://gerrit.wikimedia.org/r/467249

Mentioned in SAL (#wikimedia-operations) [2018-10-15T05:16:12Z] <marostegui> Stop MySQL on db1109 for recloning - T206743

Change 467252 had a related patch set uploaded (by Marostegui; owner: Marostegui):
[operations/mediawiki-config@master] db-eqiad.php: Slowly repool db1109

https://gerrit.wikimedia.org/r/467252

Change 467252 merged by jenkins-bot:
[operations/mediawiki-config@master] db-eqiad.php: Slowly repool db1109

https://gerrit.wikimedia.org/r/467252

Change 467260 had a related patch set uploaded (by Marostegui; owner: Marostegui):
[operations/mediawiki-config@master] db-eqiad.php: Fully repool db1109

https://gerrit.wikimedia.org/r/467260

Change 467260 merged by jenkins-bot:
[operations/mediawiki-config@master] db-eqiad.php: Fully repool db1109

https://gerrit.wikimedia.org/r/467260

Change 467261 had a related patch set uploaded (by Marostegui; owner: Marostegui):
[operations/mediawiki-config@master] db-eqiad.php: Depool db1104

https://gerrit.wikimedia.org/r/467261

Change 467261 merged by jenkins-bot:
[operations/mediawiki-config@master] db-eqiad.php: Depool db1104

https://gerrit.wikimedia.org/r/467261

Mentioned in SAL (#wikimedia-operations) [2018-10-15T07:12:16Z] <marostegui@deploy1001> Synchronized wmf-config/db-eqiad.php: Depool db1104 - T206743 (duration: 00m 49s)

Mentioned in SAL (#wikimedia-operations) [2018-10-15T07:24:08Z] <marostegui@deploy1001> Synchronized wmf-config/db-eqiad.php: Depool db1104 - T206743 (duration: 00m 48s)

Change 467285 had a related patch set uploaded (by Marostegui; owner: Marostegui):
[operations/mediawiki-config@master] db-eqiad.php: Slowly repool db1104

https://gerrit.wikimedia.org/r/467285

@Pigsonthewing Please don't get worry- as I said at T206743#4658620 only primary data was recovered, cache tables may show still wrong data until we fully recover everything this week, showing some weird data. Please be patient, but don't touch anything that seems wrong, as it will only complicate the full recovery we are doing at the moment.

Once the recovery is fully done, we will announce it here and you should have everything back- however if you edit or try to recover manually the edits, it will generate new revisions and that version will stay like that- as it will be the latest one (older versions will be stored in the history- and it may show as if you vandalized (removed content) from an article.

Addshore added a comment.EditedOct 15 2018, 8:33 AM

I wrote a little crappy but effective query that I can just run on all of the shards to see if anything else was affected.

select max(rev_id), min(rev_id), count(*), max(rev_id) - min(rev_id) as diff from ( select rev_id, rev_timestamp from revision order by rev_id DESC limit 20000000 ) as something where rev_timestamp > 20180913090816 and rev_timestamp < 20180913095825;

It shows us what happened to the rev_id in the ~50 minute period that we are concerned with.

S1 - enwiki

+-------------+-------------+----------+------+
| max(rev_id) | min(rev_id) | count(*) | diff |
+-------------+-------------+----------+------+
|   859332479 |   859327787 |     4604 | 4692 |
+-------------+-------------+----------+------+

S2 - ptwiki

+-------------+-------------+----------+------+
| max(rev_id) | min(rev_id) | count(*) | diff |
+-------------+-------------+----------+------+
|    53121516 |    53121457 |       58 |   59 |
+-------------+-------------+----------+------+

S3 - afwiki

+-------------+-------------+----------+------+
| max(rev_id) | min(rev_id) | count(*) | diff |
+-------------+-------------+----------+------+
|     1814203 |     1814188 |       16 |   15 |
+-------------+-------------+----------+------+

S4 - commonswiki

+-------------+-------------+----------+------+
| max(rev_id) | min(rev_id) | count(*) | diff |
+-------------+-------------+----------+------+
|   319952253 |   319947702 |     4387 | 4551 |
+-------------+-------------+----------+------+

S5 - dewiki

+-------------+-------------+----------+------+
| max(rev_id) | min(rev_id) | count(*) | diff |
+-------------+-------------+----------+------+
|   180869513 |   180868285 |     1188 | 1228 |
+-------------+-------------+----------+------+

S6 - frwiki

+-------------+-------------+----------+------+
| max(rev_id) | min(rev_id) | count(*) | diff |
+-------------+-------------+----------+------+
|   152158909 |   152157584 |     1301 | 1325 |
+-------------+-------------+----------+------+

S7 - arwiki

+-------------+-------------+----------+------+
| max(rev_id) | min(rev_id) | count(*) | diff |
+-------------+-------------+----------+------+
|    30515544 |    30515320 |      220 |  224 |
+-------------+-------------+----------+------+

So it looks like s8 was indeed the only issue @Marostegui

Marostegui updated the task description. (Show Details)Oct 15 2018, 8:34 AM

Change 467285 merged by jenkins-bot:
[operations/mediawiki-config@master] db-eqiad.php: Slowly repool db1104

https://gerrit.wikimedia.org/r/467285

Mentioned in SAL (#wikimedia-operations) [2018-10-15T08:46:38Z] <marostegui@deploy1001> Synchronized wmf-config/db-eqiad.php: Slowly repool db1104 - T206743 (duration: 00m 49s)

@Addshore The main task now is to check pages and pages from revisions that were lost and then restored, and check edits done since last wednesday on those pages, as, while the data has not been lost, those may have put an edit over an older version as the latest, hiding some data. We need to generate a list of Qs to review.

Mentioned in SAL (#wikimedia-operations) [2018-10-15T09:46:16Z] <marostegui@deploy1001> Synchronized wmf-config/db-eqiad.php: Depool db1092 for recloning - T206743 (duration: 00m 49s)

@Addshore The main task now is to check pages and pages from revisions that were lost and then restored, and check edits done since last wednesday on those pages, as, while the data has not been lost, those may have put an edit over an older version as the latest, hiding some data. We need to generate a list of Qs to review.

I'll generate a list once all slaves that serve mw traffic are re imaged :)

I'll generate a list once all slaves that serve mw traffic are re imaged :)

This is true right now for all pooled read only replicas, but I need to fix the master.

Mentioned in SAL (#wikimedia-operations) [2018-10-15T13:16:48Z] <jynus> stopping db1092 and db1087 in sync T206743

So as Jaime said at T206743#4666169 all the pooled replicas in eqiad have now the content from codfw, so that is now consistent.
What is pending is db1087 (depooled) which is the master for db1124 (labsdb master) and labsdb, and of course the master, db1071 which doesn't receive reads.
So labsdb still have inconsistencies.

We are now working on fixing those, db1087 which will automatically (via replication) will fix db1124 and labs.

Marostegui updated the task description. (Show Details)Oct 15 2018, 1:28 PM

I have prepared https://www.wikidata.org/wiki/User:Addshore/2018/10/DC_Switch_Issue which includes the pages that will need to be reviewed.

Mentioned in SAL (#wikimedia-operations) [2018-10-16T06:05:03Z] <jynus> stopping db1092 and db1087 in sync T206743

Update from yesterday at around 14:00UTC
@jcrespo has done an amazing job of manually checking and fixing most of the tables on db1087 (which is the labs master, and it is not as easy to reclone as the others). He's gone thru all the tables to check and fix them.
Right all the tables apart from pagelinks and wb_terms are supposed to be fixed (although replication is broken on db1124 sanitarium master for wb_items_per_site, which is kind of expected with such amount of rows to check - we are looking at it).

pagelinks and wb_terms are huge tables, and they cannot be diffed at once because our mysql client reaches OOM, so these checks need to be split on smaller diffs, that's why it is taking a bit longer.

Thanks Jaime for this huge work.

Mentioned in SAL (#wikimedia-operations) [2018-10-17T06:52:01Z] <jynus> fixing s8 master drifts T206743

Update from Jaime at 12:10 UTC
All tables on s8 master fixed except pagelinks and wb_terms

Marostegui updated the task description. (Show Details)Oct 17 2018, 1:05 PM
Banyek added a subscriber: Banyek.Oct 17 2018, 9:26 PM

on db1124 with instance s8 we have a repliation error as

Last_Error: Could not execute Delete_rows_v1 event on table wikidatawiki.pagelinks; Can't find record in 'pagelinks', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log db1087-bin.003073, end_log_pos 582738698

Update from 17th at 19:04 from Jaime:
all tables except wb_terms, which is half done, should be equal on the s8 master

on db1124 with instance s8 we have a repliation error as

Last_Error: Could not execute Delete_rows_v1 event on table wikidatawiki.pagelinks; Can't find record in 'pagelinks', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log db1087-bin.003073, end_log_pos 582738698

Where was this error message logged? I have been looking for an error log on db1124 without success.

on db1124 with instance s8 we have a repliation error as

Last_Error: Could not execute Delete_rows_v1 event on table wikidatawiki.pagelinks; Can't find record in 'pagelinks', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log db1087-bin.003073, end_log_pos 582738698

Where was this error message logged? I have been looking for an error log on db1124 without success.

Probably on show slave status, but that error was fixed already.
This host is sanitarium, so it is not user facing error (it does create lag on labs though).

This host is expected to fail while it is getting fixed.
Right now there is another error there, as replication got broken again.

Update from Jaime 18th Oct 16:05: s8 core hosts all finished getting fixed (pending labs)

Marostegui updated the task description. (Show Details)Oct 18 2018, 4:09 PM

Update: pagelinks is now being re-imported on labs (this table is around 136G) so it will take a while

After many fixes during the weekend, wb_terms also fixed on labs, all hosts should be consistent now, doing some extra checks to verify everything is good.

@Addshore did you sent to wikidata users the list you compiled to check bot activity?

The following tables have been re-checked on db1092 (recloned from codfw) vs db1087 (manually fixed):

abuse_filter_log
archive
babel
bv2013_edits
bv2015_edits
bv2017_edits
categorylinks
comment
cu_log
ipblocks
langlinks
module_deps
object_cache
querycache
querycachetwo
recentchanges
redirect
revtag
translate_reviews
translate_groupreviews
translate_groupstats
translate_messageindex
translate_sections
valid_tag
wb_changes
wb_changes_dispatch
wb_id_counters
wb_property_info
wbqc_constraints
wbs_propertypairs

On-going:

logging
revision
slots
text

Found differences on:
abuse_filter_log which has 66 rows more on db1092 than on db1087 (and sanitarium, and labs) and db1071 (master).

@Addshore did you sent to wikidata users the list you compiled to check bot activity?

Yes

Marostegui added a comment.EditedTue, Oct 23, 5:49 AM

These tables are fine:

logging
revision
slots
text

Starting to check:

abuse_filter
category 
change_tag 
change_tag_def 
cu_changes 
externallinks 
geo_tags
imagelinks
ip_changes 
iwlinks 
linter 
log_search 
ores_classification
page
page_props 
page_restrictions
pagelinks 
spoofuser 
tag_summary 
templatelinks
user
user_newtalk
user_properties
watchlist
wb_changes_subscription 
wb_items_per_site
wbc_entity_usage 
wb_terms

Mentioned in SAL (#wikimedia-operations) [2018-10-23T06:39:09Z] <marostegui> Stop replication on db1092 and db1087 for checking T206743

jcrespo lowered the priority of this task from High to Normal.Tue, Oct 23, 12:56 PM

We believe this to be fixed fully both wikireplicas and on production, but will not close until extra checks confirm so.

More tables to check after the ones checked at: T206743#4685983
abuse_filter_log (T206743#4685983) was fixed by Jaime (I have rechecked again and it is indeed now consistent).

The following tables are clean between db1087 and db1092:

abuse_filter
category
change_tag_def
cu_changes
externallinks
geo_tags
imagelinks
iwlinks
linter
log_search
ores_classification
page
page_props
page_restrictions
pagelinks
spoofuser
tag_summary
templatelinks
user
user_newtalk
user_properties
watchlist
wb_changes_subscription
wb_items_per_site
wbc_entity_usage

The following tables reported differences and have already been fixed by Jaime (and confirmed after a second check by me)

change_tag

On-going check for the last table (which takes several hours:

wb_terms
Marostegui updated the task description. (Show Details)Tue, Oct 23, 1:04 PM

wb_terms is finished and it is all clean.

The following tables are empty so no need to check:

actor
config
filearchive
filejournal
globalblocks
hidden
image
image_comment_temp
interwiki
ipblocks_restrictions
job
l10n_cache
oldimage
revision_actor_temp
searchindex
securepoll_cookie_match
securepoll_options
securepoll_questions
securepoll_strike
securepoll_votes
transcache
transcode
updatelog
uploadstash
Marostegui updated the task description. (Show Details)Wed, Oct 24, 5:31 AM
Marostegui updated the task description. (Show Details)Wed, Oct 24, 5:53 AM

Final round of tables that have been checked and are clean:

abuse_filter_action
abuse_filter_history
betafeatures_user_counts
content
content_models
global_block_whitelist
ipblocks
math
mathoid
ores_model
protected_titles
querycache_info
revision_comment_temp
securepoll_elections
securepoll_entity
securepoll_lists
securepoll_msgs
securepoll_voters
securepoll_properties
sites
site_identifiers
site_stats
slot_roles
templatelinks
translate_metadata
user_former_groups
user_groups

At this point, all the tables in s8 have been checked and confirmed clean.

Marostegui updated the task description. (Show Details)Wed, Oct 24, 8:12 AM
Marostegui closed this task as Resolved.Wed, Oct 24, 8:26 AM
Marostegui reassigned this task from Marostegui to jcrespo.

So the scope of this ticket is all done.
All the tables have been fixed and checked to ensure they are.

This has been a complicated work, specially for those hosts that were not easy to reclone (the master and the labs infra). I would like to give a big thank you to @jcrespo who's done a tremendous work on getting those fixed row by row.
Thanks also @Addshore for all the help. Really appreciate it.

Next steps are:

Pigsonthewing reopened this task as Open.Wed, Oct 24, 9:28 AM

The issue with https://www.wikidata.org/wiki/Q2058295 which I described on 14 October, persists.

I guess it is because what @Addshore described at T206743#4662054 ?

@Addshore I thought you had communicated to wikidata users about that? Apparently not, or @Pigsonthewing didn't see it, could you link your messages to him?

@Addshore I thought you had communicated to wikidata users about that? Apparently not, or @Pigsonthewing didn't see it, could you link your messages to him?

I'll leave that to @Lea_Lacroix_WMDE. This is still on the needs announcement column for us.
The related pages that I created can be found @ https://www.wikidata.org/wiki/User:Addshore/2018/10/DC_Switch_Issue

@Pigsonthewing I hope my comment at Wikidata Village Pump was helpful- if you think that is ok, I would suggest closing this task, and open a different one to track the merges of old history (this was to track the recovery from backups)?

jcrespo moved this task from In progress to Done on the DBA board.Tue, Oct 30, 2:57 PM

In particular, I see https://www.wikidata.org/wiki/Q2058295 properly merged.

Addshore closed this task as Resolved.Tue, Oct 30, 3:00 PM