-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Various improvements to data safety when log infrastructure processes…
… encounter faults. In particular there are many improvements and fixes relating to the server -> wal resend protocol including: Bug fix to ra_log_cache that would cause most triggered resends result in a ra process crash. Dropping fewer messages using the gen_state postpone feature. Ra leaders would previously just exit with wal_down - now they enter the same await_condition state although with a shorter timeout after which the begin a leader transfer process Improved detection and availability when a command is lost on the way to the wal and no further commands are sent. Also there is a new feature to configure on a per system basis what kind of server recovery should take place when a ra system starts/restarts. There are 3 options: undefined : do not restart any ra server registered: restart all locally registered servers for the system mfa: call a custom function that performs the restart. This feature will allow dynamically started ra server to be restarted should the ra system crash and restart. Also improvements to code coverage and refactoring. improvements to data safety when log infra crashes.
- Loading branch information
Showing
25 changed files
with
1,326 additions
and
328 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
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,35 @@ | ||
%% This Source Code Form is subject to the terms of the Mozilla Public | ||
%% License, v. 2.0. If a copy of the MPL was not distributed with this | ||
%% file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
%% | ||
%% Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term Broadcom refers to Broadcom Inc. and/or its subsidiaries. | ||
%% | ||
%% @hidden | ||
-module(ra_file). | ||
|
||
-include("ra.hrl"). | ||
|
||
-define(HANDLE_EAGAIN(Op), | ||
case Op of | ||
{error, eagain} -> | ||
?INFO("EAGAIN during file operation, retrying once in 10ms...", []), | ||
timer:sleep(10), | ||
case Op of | ||
{error, eagain} = Err -> | ||
?INFO("EAGAIN again during file operation", []), | ||
Err; | ||
Res -> | ||
Res | ||
end; | ||
Res -> | ||
Res | ||
end). | ||
|
||
-export([ | ||
% open/1, | ||
% write/2, | ||
sync/1 | ||
]). | ||
|
||
sync(Fd) -> | ||
?HANDLE_EAGAIN(file:sync(Fd)). |
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
Oops, something went wrong.