mirror of
https://github.com/facebook/sapling.git
synced 2024-12-27 23:22:02 +03:00
Change API between SwSwitch and HwSwitch to indicate HwSwitch might fail some
Summary: Depend on D4492997 Currently, we assume that changes applied to HwSwitch always succeed (or the process exits). There is a case where we want to keep moving despite failures: when we get excessive number of route (probably) because of some misconfiguration. This diff is a step towards taking care of such situation. We change the interface between SwSwitch and HwSwitch so that HwSwitch, when asked to apply delta of old and new state, returns either the new state if it succeeds, or returns a "pruned version of new state" if some elements of new state it was not able to apply. SwSwitch now keeps track of two states, a state that has been applied in the hardware, and another one that is desired in hardware. SwSwitch strives to catch applied state to the desired state (while desired state is also changes as move state updates are arriving). One issue with this diff: Warmboot is not preserving "unapplied" routes, i.e., unapplied routes get lost across warmboots. This will be fixed in a seperate diff. One naming issue: I thought about keeping SwSwitch::getState() name intact, but thought that it is not a good idea to keep distinction of states opaque to callers. So, decided to change the name. Reviewed By: ninas Differential Revision: D4405751 fbshipit-source-id: c933b4418445ae49d5b8e21dea95e437a8e1593d
This commit is contained in:
parent
03bdaff954
commit
9bbee241e6
@ -37,6 +37,13 @@ public:
|
||||
void addRepeatedValue(int64_t /*value*/, int64_t /*nsamples*/) {}
|
||||
};
|
||||
|
||||
class TLCounter {
|
||||
public:
|
||||
TLCounter(ThreadLocalStatsMap*, folly::StringPiece) {}
|
||||
void incrementValue(int64_t) {}
|
||||
|
||||
};
|
||||
|
||||
static ThreadCachedServiceData* get() {
|
||||
static ThreadCachedServiceData it;
|
||||
return ⁢
|
||||
|
Loading…
Reference in New Issue
Block a user