Motr  M0
remach.h
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2013-2020 Seagate Technology LLC and/or its Affiliates
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  * For any questions about this software or licensing,
18  * please email opensource@seagate.com or cortx-questions@seagate.com.
19  *
20  */
21 
22 #pragma once
23 
24 #ifndef __MOTR___DTM0_REMACH_H__
25 #define __MOTR___DTM0_REMACH_H__
26 
33 /*
34  * DTM0 recovery machine (remach) overview
35  * ---------------------------------------
36  *
37  * Recovery machine is a component responsible for handling of REDO messages
38  * in case of failures reported by DTM0 HA component. REDO messages are read
39  * from DTM0 log and applied on the recepient side to the user service (for
40  * example, CAS) and, though the user service, to the local repceient's log.
41  * There are other messages that contol recovery process: End-of-Log (EOL)
42  * and PERSISTENT (P). EOL is sent when the sender reached the end of its
43  * DTM0 log. P message usually accompanies a REDO message when the REDO message
44  * is formed by a persistent log record.
45  * Recovery machine reacts to TRANSIENT, FAILED, ONLINE and RECOVERING
46  * notifications sent from the HA subsystem. When a participant enters the
47  * T state, it causes the machine to halt any interaction with it.
48  * The F state causes eviction of the failed participant. The R state
49  * causes an attempt to recover the participant after transient failure.
50  * The O state indicates that no recovery procedures required for the
51  * participant.
52  *
53  * Interactions with other components:
54  *
55  * +--------+ +----------+
56  * | Remach | --- tx_desc+op --> | User svc | -------+
57  * | | | (CAS/DIX)| record
58  * | | +----------+ \|/
59  * | | +-----+
60  * | | <------ record, P ------------------| Log |
61  * | | +-----+
62  * | | +-----+
63  * | | -- REDO,P,EOL msg -> | Net |
64  * | | <-- REDO,EOL msg --- | |
65  * | | +-----+ +----+
66  * | | <------------------------------- F/O/R/T -> | HA |
67  * +--------+ +----+
68  */
69 
71 };
72 
74 };
75 
76 M0_INTERNAL int m0_dtm0_remach_init(struct m0_dtm0_remach *drm,
77  struct m0_dtm0_remach_cfg *drm_cfg);
78 M0_INTERNAL void m0_dtm0_remach_fini(struct m0_dtm0_remach *drm);
79 M0_INTERNAL void m0_dtm0_remach_start(struct m0_dtm0_remach *drm);
80 M0_INTERNAL void m0_dtm0_remach_stop(struct m0_dtm0_remach *drm);
81 
83 #endif /* __MOTR___DTM0_REMACH_H__ */
84 
85 /*
86  * Local variables:
87  * c-indentation-style: "K&R"
88  * c-basic-offset: 8
89  * tab-width: 8
90  * fill-column: 80
91  * scroll-step: 1
92  * End:
93  */
94 /*
95  * vim: tabstop=8 shiftwidth=8 noexpandtab textwidth=80 nowrap
96  */
M0_INTERNAL int m0_dtm0_remach_init(struct m0_dtm0_remach *drm, struct m0_dtm0_remach_cfg *drm_cfg)
Definition: remach.c:33
M0_INTERNAL void m0_dtm0_remach_fini(struct m0_dtm0_remach *drm)
Definition: remach.c:39
M0_INTERNAL void m0_dtm0_remach_start(struct m0_dtm0_remach *drm)
Definition: remach.c:43
M0_INTERNAL void m0_dtm0_remach_stop(struct m0_dtm0_remach *drm)
Definition: remach.c:47