Drupal installer will fail when using Percona XtraDB Cluster if pxc_strict_mode is set to enforced.

If pxc_strict_mode is set to enforced (which is the default and wanted value in most case), Percona XtraDB Cluster will deny a request if an operation is performed on a table without an explicit primary key. See https://www.percona.com/doc/percona-xtradb-cluster/5.7/features/pxc-stri...

The Drupal install test table created by the install process is created without a primary key. In this case, the installer fails because Percona XtraDB Cluster deny the request.

Comments

Surian created an issue. See original summary.

Surian’s picture

Status: Active » Needs review
StatusFileSize
new786 bytes

In attachment, a little patch to fix this issue.

Status: Needs review » Needs work

The last submitted patch, 2: core-2856362.patch, failed testing.

WamFlying’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new3.3 KB

Apply the primary key principle, everywhere the drupal_install_test table is used.

tstoeckler’s picture

Status: Reviewed & tested by the community » Needs review

Please don't RTBC your own patch.

Also sending for a test on all supported DB drivers.

bpresles’s picture

The provided patch is not working, as it keeps the id as NULLable, which is not allowed by Percona. This raises the following error: "ERROR 1171 (42000): All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead"

Therefore the SQL CREATE TABLE query must create the id column as NOT NULL.

Find attached an updated patch that fixes this issue.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

andreperazzi’s picture

Drupal installation was failing for me when trying to set it up with Compose.io Mysql - it has replication on by default
This patch fixed the issue, thanks for sharing and looking forward to getting this merged

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

andyrigby’s picture

Status: Needs review » Reviewed & tested by the community

The patch in #6 resolves the issue for us too. Thanks!

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

Unfortunately the patch doesn't apply to 8.6.x. The fix looks solid and makes sense. +1 for the direction.

bpresles’s picture

Here is a patch for Drupal 8.6.

bpresles’s picture

Status: Needs work » Needs review
bpresles’s picture

Sorry I forgot to update the assertRaw() message in the InstallerTranslationTest's setUpSettings() message

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

matiasmiranda’s picture

The same occurs if you are using MySQL with group replication:
https://dev.mysql.com/doc/refman/8.0/en/group-replication-requirements.html

Primary Keys. Every table that is to be replicated by the group must have a defined primary key, or primary key equivalent where the equivalent is a non-null unique key. Such keys are required as a unique identifier for every row within a table, enabling the system to determine which transactions conflict by identifying exactly which rows each transaction has modified.

amateescu’s picture

Status: Needs review » Reviewed & tested by the community

The patch looks great to me.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed b6779d931c to 8.7.x and e721b52c8c to 8.6.x. Thanks!

Backported as this is a non-disruptive bug fix.

  • alexpott committed b6779d9 on 8.7.x
    Issue #2856362 by bpresles, Surian, WamFlying: Drupal install fail on...

  • alexpott committed e721b52 on 8.6.x
    Issue #2856362 by bpresles, Surian, WamFlying: Drupal install fail on...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.