mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge from merge-myrocks:
commit 445e518bc7
Author: Sergei Petrunia <psergey@askmonty.org>
Date: Sat Jan 27 10:18:20 2018 +0000
Copy of
commit f8f364b47f2784f16b401f27658f1c16eaf348ec
Author: Jay Edgar <jkedgar@fb.com>
Date: Tue Oct 17 15:19:31 2017 -0700
Add a hashed, hierarchical, wheel timer implementation
Summary:
In order to implement idle timeouts on detached sessions we need something inside MySQL that is lightweight and can handle calling events in the future wi
By default the timers are grouped into 10ms buckets (the 'hashed' part), though the size of the buckets is configurable at the creation of the timer. Eac
Reviewed By: djwatson
Differential Revision: D6199806
fbshipit-source-id: 5e1590f
This commit is contained in:
@@ -352,4 +352,30 @@ const char *get_rocksdb_supported_compression_types()
|
||||
return compression_methods_buf.c_str();
|
||||
}
|
||||
|
||||
bool rdb_check_rocksdb_corruption() {
|
||||
return !my_access(myrocks::rdb_corruption_marker_file_name().c_str(), F_OK);
|
||||
}
|
||||
|
||||
void rdb_persist_corruption_marker() {
|
||||
const std::string &fileName(myrocks::rdb_corruption_marker_file_name());
|
||||
int fd = my_open(fileName.c_str(), O_CREAT | O_SYNC, MYF(MY_WME));
|
||||
if (fd < 0) {
|
||||
sql_print_error("RocksDB: Can't create file %s to mark rocksdb as "
|
||||
"corrupted.",
|
||||
fileName.c_str());
|
||||
} else {
|
||||
sql_print_information("RocksDB: Creating the file %s to abort mysqld "
|
||||
"restarts. Remove this file from the data directory "
|
||||
"after fixing the corruption to recover. ",
|
||||
fileName.c_str());
|
||||
}
|
||||
|
||||
int ret = my_close(fd, MYF(MY_WME));
|
||||
if (ret) {
|
||||
// NO_LINT_DEBUG
|
||||
sql_print_error("RocksDB: Error (%d) closing the file %s", ret,
|
||||
fileName.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace myrocks
|
||||
|
Reference in New Issue
Block a user