-
Notifications
You must be signed in to change notification settings - Fork 482
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PS-5932: Implementing --tokudb-force-recovery=6 to skip reading the logs
This could be useful when the server crashed with a corrupted rollback file, and is unable to start up. Specifying --tokudb--force-recovery=6 --super-read-only should start it up in a read-only, but usable state. Some data may be lost and unrecoverable. Starting the server without the read only option is NOT supported.
- Loading branch information
Showing
9 changed files
with
125 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
create table t (a int, b int, primary key (a)) engine=tokudb; | ||
insert into t values (1,2),(2,4),(3,8); | ||
optimize table t; | ||
Table Op Msg_type Msg_text | ||
test.t optimize note Table does not support optimize, doing recreate + analyze instead | ||
test.t optimize status OK | ||
# restart | ||
insert into t values (4,9),(10,11),(12,13); | ||
select * from t; | ||
a b | ||
1 2 | ||
2 4 | ||
3 8 | ||
4 9 | ||
10 11 | ||
12 13 | ||
# Kill the server | ||
# restart:--tokudb-force-recovery=6 --read-only --super-read-only | ||
select * from t; | ||
a b | ||
1 2 | ||
2 4 | ||
3 8 | ||
# restart:--tokudb-force-recovery=6 --read-only --super-read-only | ||
select * from t; | ||
a b | ||
1 2 | ||
2 4 | ||
3 8 | ||
# restart | ||
drop table t; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
mvcc-19: tokutek | ||
mvcc-20: tokutek | ||
mvcc-27: tokutek | ||
recovery: fails when ran together with other tests | ||
storage_engine_default: tokudb is not the default storage engine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--source include/have_tokudb.inc | ||
|
||
# verify that delete from table leaves the table empty | ||
create table t (a int, b int, primary key (a)) engine=tokudb; | ||
insert into t values (1,2),(2,4),(3,8); | ||
|
||
--let $MYSQLD_DATADIR= `select @@datadir` | ||
|
||
optimize table t; | ||
|
||
--source include/restart_mysqld.inc | ||
|
||
insert into t values (4,9),(10,11),(12,13); | ||
|
||
select * from t; | ||
|
||
--source include/kill_mysqld.inc | ||
|
||
--exec mv $MYSQLD_DATADIR/tokudb.rollback $MYSQLD_DATADIR/rollback.backup | ||
# Create an empty rollback file that tokudb can't interpret | ||
--exec echo "" > $MYSQLD_DATADIR/tokudb.rollback | ||
# Make everything read only - to make sure the server can't write these files | ||
--exec find $MYSQLD_DATADIR -type f -name "*toku*" | xargs chmod u-w | ||
|
||
--let $restart_parameters= restart:--tokudb-force-recovery=6 --read-only --super-read-only | ||
--source include/start_mysqld.inc | ||
|
||
select * from t; | ||
|
||
--let $restart_parameters= restart:--tokudb-force-recovery=6 --read-only --super-read-only | ||
--source include/restart_mysqld.inc | ||
|
||
select * from t; | ||
|
||
--source include/shutdown_mysqld.inc | ||
# Restore rollback & RW permissions | ||
--exec find $MYSQLD_DATADIR -type f -name "*toku*" | xargs chmod u+w | ||
--exec rm $MYSQLD_DATADIR/tokudb.rollback | ||
--exec mv $MYSQLD_DATADIR/rollback.backup $MYSQLD_DATADIR/tokudb.rollback | ||
--let $restart_parameters= | ||
--source include/start_mysqld.inc | ||
|
||
# Cleanup recovery files | ||
--exec rm $MYSQLD_DATADIR/tokudb.rollback2 | ||
--exec rm $MYSQLD_DATADIR/tokudb.environment2 | ||
--exec rm $MYSQLD_DATADIR/*.___lock_dont_delete_me2 | ||
drop table t; |
Submodule PerconaFT
updated
6 files
+8 −8 | ft/ft-ops.cc | |
+2 −2 | ft/ft-ops.h | |
+5 −5 | ft/ft.h | |
+41 −6 | src/ydb.cc | |
+6 −2 | src/ydb_db.cc | |
+1 −0 | src/ydb_db.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters