Page MenuHomePhabricator

Simultaneous edits to posts can cause an exception for the losing party
Open, Needs TriagePublic

Description

Exception Caught: Flow\SubmissionHandler::commit: Expected mass rollback of all peer databases (DBO_TRX set).

{
  "_index": "logstash-2016.11.09",
  "_type": "mediawiki",
  "_id": "AVhKyhGvxgigAG7oUtaU",
  "_score": null,
  "_source": {
    "message": "Flow\\Data\\Storage\\RevisionStorage::insert\t10.68.23.30\t1062\tDuplicate entry '\\x05N\\xBD\\xE9\\xD7\\xB1>O@\\xAF\\x18' for key 'flow_revision_unique_parent' (10.68.23.30)\tINSERT  INTO `flow_revision` (rev_id,rev_user_id,rev_user_ip,rev_user_wiki,rev_parent_id,rev_change_type,rev_type,rev_type_id,rev_content,rev_flags,rev_mod_state,rev_mod_user_id,rev_mod_user_ip,rev_mod_user_wiki,rev_mod_timestamp,rev_mod_reason,rev_last_edit_id,rev_edit_user_id,rev_edit_user_ip,rev_edit_user_wiki,rev_content_length,rev_previous_content_length) VALUES ('\u0005a+(9ãî4)˜\u000f','74',NULL,'hewiki','\u0005Nœé×±>O@¯\u0018','edit-post','post','\u0005Nœé×±>O@¯\u0018','DB://flow_cluster1/35','utf-8,gzip,html,external','',NULL,NULL,NULL,NULL,NULL,'\u0005a+(9ãî4)˜\u000f','74',NULL,'hewiki','26','11')",
    "@version": 1,
    "@timestamp": "2016-11-09T20:31:45.000Z",
    "type": "mediawiki",
    "host": "deployment-mediawiki05",
    "level": "ERROR",
    "tags": [
      "syslog",
      "es",
      "es"
    ],
    "channel": "DBQuery",
    "normalized_message": "{fname}\t{db_server}\t{errno}\t{error}\t{sql1line}",
    "url": "/w/api.php",
    "ip": "10.68.18.103",
    "http_method": "POST",
    "server": "he.wikipedia.beta.wmflabs.org",
    "referrer": "https://he.wikipedia.beta.wmflabs.org/wiki/%D7%A0%D7%95%D7%A9%D7%90:Sgbtimu66bgphlaw",
    "unique_id": "WCOHsQpEFhUAACvODzUAAAAK",
    "wiki": "hewiki",
    "mwversion": "1.29.0-alpha",
    "reqId": "WCOHsQpEFhUAACvODzUAAAAK",
    "db_server": "10.68.23.30",
    "db_name": "hewiki",
    "db_user": "wikiadmin",
    "method": "Database::reportQueryError",
    "errno": 1062,
    "error": "Duplicate entry '\\x05N\\xBD\\xE9\\xD7\\xB1>O@\\xAF\\x18' for key 'flow_revision_unique_parent' (10.68.23.30)",
    "sql1line": "INSERT  INTO `flow_revision` (rev_id,rev_user_id,rev_user_ip,rev_user_wiki,rev_parent_id,rev_change_type,rev_type,rev_type_id,rev_content,rev_flags,rev_mod_state,rev_mod_user_id,rev_mod_user_ip,rev_mod_user_wiki,rev_mod_timestamp,rev_mod_reason,rev_last_edit_id,rev_edit_user_id,rev_edit_user_ip,rev_edit_user_wiki,rev_content_length,rev_previous_content_length) VALUES ('\u0005a+(9ãî4)˜\u000f','74',NULL,'hewiki','\u0005Nœé×±>O@¯\u0018','edit-post','post','\u0005Nœé×±>O@¯\u0018','DB://flow_cluster1/35','utf-8,gzip,html,external','',NULL,NULL,NULL,NULL,NULL,'\u0005a+(9ãî4)˜\u000f','74',NULL,'hewiki','26','11')",
    "fname": "Flow\\Data\\Storage\\RevisionStorage::insert"
  },
  "fields": {
    "@timestamp": [
      1478723505000
    ]
  },
  "highlight": {
    "unique_id": [
      "@kibana-highlighted-field@WCOHsQpEFhUAACvODzUAAAAK@/kibana-highlighted-field@"
    ],
    "reqId": [
      "@kibana-highlighted-field@WCOHsQpEFhUAACvODzUAAAAK@/kibana-highlighted-field@"
    ]
  },
  "sort": [
    1478723505000
  ]
}

Event Timeline

SBisson created this task.Nov 10 2016, 2:58 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 10 2016, 2:58 PM

Change 320842 had a related patch set uploaded (by Catrope):
Use rollbackMasterChanges instead of rollback in SubmissionHandler

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

Change 320842 had a related patch set uploaded (by Catrope):
Use rollbackMasterChanges instead of rollback in SubmissionHandler
https://gerrit.wikimedia.org/r/320842

This patch addresses the broken/aborted rollback, but it doesn't fix the bug as a whole. You still get an exception, but instead of the "Excepted mass rollback" one you now get a normal DB exception:

Exception Caught: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? Query: INSERT INTO `flow_revision` (rev_id,rev_user_id,rev_user_ip,rev_user_wiki,rev_parent_id,rev_change_type,rev_type,rev_type_id,rev_content,rev_flags,rev_mod_state,rev_mod_user_id,rev_mod_user_ip,rev_mod_user_wiki,rev_mod_timestamp,rev_mod_reason,rev_last_edit_id,rev_edit_user_id,rev_edit_user_ip,rev_edit_user_wiki,rev_content_length,rev_previous_content_length) VALUES ('�a@�5\\�iH��','1',NULL,'wiki','�a@\r���iH��','edit-post','post','�a?�а�iH��','
defy

','utf-8,html','',NULL,NULL,NULL,NULL,NULL,'�a@�5\\�iH��','1',NULL,'wiki','4','4') Function: Flow\Data\Storage\RevisionStorage::insert Error: 1062 Duplicate entry '\x05a@\x0D\xA4\x80\x87iH\xDD\xCD' for key 'flow_revision_unique_parent' (127.0.0.1)

Change 320842 merged by jenkins-bot:
Use rollbackMasterChanges instead of rollback in SubmissionHandler

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