-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FR: if --exact-rowcount=true, don't wait for count to return before starting #194
Comments
That is true, and the number is never really absolutely correct, but experience shows that it is nonetheless very close to the real value; on our largest migrations I've see it off by less than I think the big deal here is "are we willing to pay an extra 30 minutes for the Running the This will have the:
We can make this optional and the user can choose desired behavior. |
Waiting the first 30 minutes of a migration by just waiting for |
On an insert heavy table running the Does it adjust the count when gh-ost sees |
True; my idea is more about saving that delay at the beginning. @jonahberquist noted, though, that if the row copying and binlog parsing began at the same time as the |
@dveeden good idea, thank you
Yes, it adjusts the count on However these are pretty accurate as they are; I wouldn't invest much effort in those counters. |
@ggunson that's true. Work begins at #196 |
Noting down that this applies whether |
I wasn't very scientific in my testing but changing the session isolation level between repeatable read, read committed and read uncommitted didn't make a difference (or much of one) in terms of undo log growth on a 5.7 replica. Which makes sense to me in the context of a read-only select in autocommit mode. If the select is run on its own (not inside a greater transaction with writes), I don't know if setting the session transaction level to read-committed would be helpful for non-locking, either. But please correct me if I'm wrong about this. |
This is what it looks like, in production:
Notice how |
Closed by #196 |
SELECT COUNT(*) FROM table
can take a long time with large tables, and is slower on MySQL 5.7 than 5.6, according to this bug report: https://bugs.mysql.com/bug.php?id=80580Using the
--exact-rowcount
flag, gh-ost gets a count of the table before it starts copying rows, so that the progress and estimated completion times are more accurate than using table statistics for the calculations.If the flag is used on a big migration, the migration can be delayed several minutes (we saw upwards of 40 minutes in practice using a 5.7 replica) waiting for the count, and the row count is now 40 minutes old and is no longer accurate on an insert-heavy table.
Is it possible to start the row copy prior to getting the count and check on the result later as it would with the various panic/postpone flag files? It can take a while for gh-ost to display an estimated completion time already, even after it has the count.
/cc @github/database-infrastructure
The text was updated successfully, but these errors were encountered: