Documentation bug on pt-osc --check-plan?

Bug #1482783 reported by Peiran
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
Confirmed
Undecided
Unassigned

Bug Description

In the documentation https://www.percona.com/doc/percona-toolkit/2.2/pt-online-schema-change.html, for --check-plan, it mentioned a couple times that the tool could potentially skip chunks. If the tool indeed would skip copying certain chunks instead of error out, it would be too dangerous to use in production.

Here are the blurbs from the doc:
" If it appears that MySQL will use a bad query execution plan, the tool will skip the chunk of the table."

"The tool remembers the largest key_len seen, and skips chunks where MySQL reports that it will use a smaller prefix of the index. This heuristic can be understood as skipping chunks that have a worse execution plan than other chunks."

"The tool prints a warning the first time a chunk is skipped due to a bad execution plan in each table. Subsequent chunks are skipped silently, although you can see the count of skipped chunks in the SKIPPED column in the tool’s output."

From a quick look into the code, it looks like every time check-plan fails, it calls "die()" to terminate the job. I would like to double check that "skip chunk" is just a documentation bug.

tags: added: pt-online-schema-change
Revision history for this message
Nilnandan Joshi (nilnandan-joshi) wrote :

Hi Frank,

As per the code, it seems, that it calls die. Should we need to verify with specific test case?

else { # chunking the table
           if ( $o->get('check-plan') ) {
              my $idx_len = new IndexLength(Quoter => $q);
              my ($key_len, $key) = $idx_len->index_length(
                 Cxn => $args{Cxn},
                 tbl => $tbl,
                 index => $nibble_iter->nibble_index(),
                 n_index_cols => $o->get('chunk-index-columns'),
              );
              if ( !$key || lc($key) ne lc($nibble_iter->nibble_index()) ) {
                 die ts("Cannot determine the key_len of the chunk index "
                    . "because MySQL chose "
                    . ($key ? "the $key" : "no") . " index "
                    . "instead of the " . $nibble_iter->nibble_index()
                    . " index for the first lower boundary statement. "
                    . "See --[no]check-plan in the documentation for more "
                    . "information.");
              }
              elsif ( !$key_len ) {
                 die ts("The key_len of the $key index is "
                    . (defined $key_len ? "zero" : "NULL")
                    . ", but this should not be possible. "
                    . "See --[no]check-plan in the documentation for more "
                    . "information.");
              }
              $tbl->{key_len} = $key_len;
           }
        }

Changed in percona-toolkit:
status: New → Confirmed
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PT-1296

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.