Uploaded image for project: 'Percona Toolkit'
  1. Percona Toolkit
  2. PT-289

LP #918056: pt-table-sync false-positive error "Cannot nibble table because MySQL chose no index instead of the PRIMARY index"

    XMLWordPrintable

    Details

      Description

      **Reported in Launchpad by Miguel Angel Nieto last update 27-03-2016 16:03:54

      If I try to use pt-table-sync on the employees database (https://launchpad.net/test-db/) to correct some mistakes I receive this error message:

      1. pt-table-sync --print --replicate percona.checksums u=root,p=msandbox,h=127.0.0.1,P=26165
        Cannot nibble table `employees`.`dept_emp` because MySQL chose no index instead of the `PRIMARY` index at /usr/bin/pt-table-sync line 4748. while doing employees.dept_emp on SBslave1
        Cannot nibble table `employees`.`salaries` because MySQL chose no index instead of the `PRIMARY` index at /usr/bin/pt-table-sync line 4748. while doing employees.salaries on SBslave1
        Cannot nibble table `employees`.`dept_emp` because MySQL chose no index instead of the `PRIMARY` index at /usr/bin/pt-table-sync line 4748. while doing employees.dept_emp on SBslave2
        Cannot nibble table `employees`.`salaries` because MySQL chose no index instead of the `PRIMARY` index at /usr/bin/pt-table-sync line 4748. while doing employees.salaries on SBslave2

      slave1 [localhost]

      {msandbox} (employees) > show create table dept_emp\G
      *************************** 1. row ***************************
      Table: dept_emp
      Create Table: CREATE TABLE `dept_emp` (
      `emp_no` int(11) NOT NULL,
      `dept_no` char(4) NOT NULL,
      `from_date` date NOT NULL,
      `to_date` date NOT NULL,
      PRIMARY KEY (`emp_no`,`dept_no`),
      KEY `emp_no` (`emp_no`),
      KEY `dept_no` (`dept_no`)
      ) ENGINE=MyISAM DEFAULT CHARSET=latin1

      slave1 [localhost] {msandbox}

      (employees) > show create table salaries\G

                                                          • 1. row ***************************
                                                            Table: salaries
                                                            Create Table: CREATE TABLE `salaries` (
                                                            `emp_no` int(11) NOT NULL,
                                                            `salary` int(11) NOT NULL,
                                                            `from_date` date NOT NULL,
                                                            `to_date` date NOT NULL,
                                                            PRIMARY KEY (`emp_no`,`from_date`),
                                                            KEY `emp_no` (`emp_no`)
                                                            ) ENGINE=MyISAM DEFAULT CHARSET=latin1

        Smart Checklist

          Attachments

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              lpjirasync lpjirasync (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: