mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 18:35:46 +02:00
fix: prevents Dragonfly from blocking in epoll during snapshotting (#3911)
The problem - we used file write in non-direct mode when writing snapshots in epoll mode. As a result - lots of data was cached into OS memory. But then during the rename operation, when we rename "xxx.dfs.tmp" into "xxx.dfs", the OS flushes the file caches and the thread is stuck in OS system call rename for a long time. The fix - to use DIRECT mode and to avoid caching the data into OS caches at all. Fixes #3895 Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
parent
ba57145c53
commit
4012ad1855
5 changed files with 10 additions and 5 deletions
|
@ -62,7 +62,6 @@ extern "C" {
|
|||
#include "strings/human_readable.h"
|
||||
#include "util/accept_server.h"
|
||||
#include "util/aws/aws.h"
|
||||
#include "util/fibers/fiber_file.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
@ -1654,6 +1653,7 @@ GenericError ServerFamily::WaitUntilSaveFinished(Transaction* trans, bool ignore
|
|||
save_controller_->WaitAllSnapshots();
|
||||
detail::SaveInfo save_info;
|
||||
|
||||
VLOG(1) << "Before WaitUntilSaveFinished::Finalize";
|
||||
{
|
||||
util::fb2::LockGuard lk(save_mu_);
|
||||
save_info = save_controller_->Finalize();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue