LP #1482783: Documentation bug on pt-osc --check-plan?

Description

**Reported in Launchpad by Peiran last update 15-09-2015 07:22:22

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 tools 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.

Environment

None

Smart Checklist

Activity

Show:

lpjirasync January 24, 2018 at 8:45 PM

**Comment from Launchpad by: Nilnandan Joshi on: 15-09-2015 07:22:11

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;
}
}

Details

Assignee

Reporter

Priority

Components

Fix versions

Smart Checklist

Created January 24, 2018 at 8:45 PM
Updated January 13, 2024 at 8:58 PM