Skip to content

Commit

Permalink
Merge branch 'release-1.115.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
niksv committed Mar 1, 2022
2 parents d1b80f2 + c7cb804 commit 39652d3
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 53 deletions.
15 changes: 13 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## v1.115.1 (21/02/2022)

### Bug Fixes:
- [#4705](https://github.com/telstra/open-kilda/pull/4705) Sync misconfigured and excess meters [**storm-topologies**]
- [#4706](https://github.com/telstra/open-kilda/pull/4706) Fix build by pinning markupsafe version

For the complete list of changes, check out [the commit log](https://github.com/telstra/open-kilda/compare/v1.115.0...v1.115.1).

### Affected Components:
swmanager

---

## v1.115.0 (17/02/2022)

### Features:
Expand All @@ -13,8 +26,6 @@
- [#4691](https://github.com/telstra/open-kilda/pull/4691) Fix the output port for a single switch and same port flow
- [#4697](https://github.com/telstra/open-kilda/pull/4697) Fix rule manager switch validation [**storm-topologies**]



For the complete list of changes, check out [the commit log](https://github.com/telstra/open-kilda/compare/v1.114.0...v1.115.0).

### Affected Components:
Expand Down
60 changes: 30 additions & 30 deletions docs/design/hub-and-spoke/switch-sync/switch-sync-fsm.dot
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,55 @@ digraph {
compound=true;
subgraph cluster_StateMachine {
label="org.openkilda.wfm.topology.switchmanager.fsm.SwitchSyncFsm";
COMPUTE_EXCESS_RULES [label="COMPUTE_EXCESS_RULES"];
COMPUTE_MISCONFIGURED_RULES [label="COMPUTE_MISCONFIGURED_RULES"];
GROUPS_COMMANDS_SEND [label="GROUPS_COMMANDS_SEND"];
RULES_COMMANDS_SEND [label="RULES_COMMANDS_SEND"];
METERS_COMMANDS_SEND [label="METERS_COMMANDS_SEND"];
LOGICAL_PORTS_COMMANDS_SEND [label="LOGICAL_PORTS_COMMANDS_SEND"];
FINISHED_WITH_ERROR [label="FINISHED_WITH_ERROR"];
INITIALIZED [label="INITIALIZED"];
COMPUTE_EXCESS_RULES [label="COMPUTE_EXCESS_RULES"];
COMPUTE_GROUP_MIRROR_CONFIGS [label="COMPUTE_GROUP_MIRROR_CONFIGS"];
COMPUTE_LOGICAL_PORTS_COMMANDS [label="COMPUTE_LOGICAL_PORTS_COMMANDS"];
LOGICAL_PORTS_COMMANDS_SEND [label="LOGICAL_PORTS_COMMANDS_SEND"];
RULES_COMMANDS_SEND [label="RULES_COMMANDS_SEND"];
COMPUTE_MISSING_RULES [label="COMPUTE_MISSING_RULES"];
COMPUTE_MISCONFIGURED_RULES [label="COMPUTE_MISCONFIGURED_RULES"];
FINISHED [label="FINISHED"];
FINISHED_WITH_ERROR [label="FINISHED_WITH_ERROR"];
COMPUTE_EXCESS_METERS [label="COMPUTE_EXCESS_METERS"];
COMPUTE_MISCONFIGURED_METERS [label="COMPUTE_MISCONFIGURED_METERS"];
COMPUTE_GROUP_MIRROR_CONFIGS [label="COMPUTE_GROUP_MIRROR_CONFIGS"];
METERS_COMMANDS_SEND [label="METERS_COMMANDS_SEND"];
FINISHED [label="FINISHED"];

LOGICAL_PORTS_COMMANDS_SEND -> LOGICAL_PORTS_COMMANDS_SEND [ label="LOGICAL_PORT_INSTALLED"];
LOGICAL_PORTS_COMMANDS_SEND -> LOGICAL_PORTS_COMMANDS_SEND [ label="LOGICAL_PORT_REMOVED"];
LOGICAL_PORTS_COMMANDS_SEND -> FINISHED_WITH_ERROR [ label="TIMEOUT"];
LOGICAL_PORTS_COMMANDS_SEND -> FINISHED_WITH_ERROR [ label="ERROR"];
LOGICAL_PORTS_COMMANDS_SEND -> GROUPS_COMMANDS_SEND [ label="NEXT"];
COMPUTE_EXCESS_RULES -> FINISHED_WITH_ERROR [ label="ERROR"];
COMPUTE_EXCESS_RULES -> COMPUTE_EXCESS_METERS [ label="NEXT"];
COMPUTE_MISCONFIGURED_RULES -> FINISHED_WITH_ERROR [ label="ERROR"];
COMPUTE_MISCONFIGURED_RULES -> COMPUTE_EXCESS_RULES [ label="NEXT"];
GROUPS_COMMANDS_SEND -> GROUPS_COMMANDS_SEND [ label="GROUPS_INSTALLED"];
GROUPS_COMMANDS_SEND -> GROUPS_COMMANDS_SEND [ label="GROUPS_MODIFIED"];
GROUPS_COMMANDS_SEND -> GROUPS_COMMANDS_SEND [ label="GROUPS_REMOVED"];
GROUPS_COMMANDS_SEND -> FINISHED_WITH_ERROR [ label="TIMEOUT"];
GROUPS_COMMANDS_SEND -> FINISHED_WITH_ERROR [ label="ERROR"];
GROUPS_COMMANDS_SEND -> RULES_COMMANDS_SEND [ label="NEXT"];
GROUPS_COMMANDS_SEND -> METERS_COMMANDS_SEND [ label="NEXT"];
INITIALIZED -> COMPUTE_MISSING_RULES [ label="NEXT"];
COMPUTE_LOGICAL_PORTS_COMMANDS -> FINISHED_WITH_ERROR [ label="ERROR"];
COMPUTE_LOGICAL_PORTS_COMMANDS -> LOGICAL_PORTS_COMMANDS_SEND [ label="NEXT"];
LOGICAL_PORTS_COMMANDS_SEND -> LOGICAL_PORTS_COMMANDS_SEND [ label="LOGICAL_PORT_INSTALLED"];
LOGICAL_PORTS_COMMANDS_SEND -> LOGICAL_PORTS_COMMANDS_SEND [ label="LOGICAL_PORT_REMOVED"];
LOGICAL_PORTS_COMMANDS_SEND -> FINISHED_WITH_ERROR [ label="TIMEOUT"];
LOGICAL_PORTS_COMMANDS_SEND -> FINISHED_WITH_ERROR [ label="ERROR"];
LOGICAL_PORTS_COMMANDS_SEND -> GROUPS_COMMANDS_SEND [ label="NEXT"];
RULES_COMMANDS_SEND -> RULES_COMMANDS_SEND [ label="MISSING_RULES_INSTALLED"];
RULES_COMMANDS_SEND -> RULES_COMMANDS_SEND [ label="EXCESS_RULES_REMOVED"];
RULES_COMMANDS_SEND -> RULES_COMMANDS_SEND [ label="MISCONFIGURED_RULES_REINSTALLED"];
RULES_COMMANDS_SEND -> FINISHED_WITH_ERROR [ label="TIMEOUT"];
RULES_COMMANDS_SEND -> FINISHED_WITH_ERROR [ label="ERROR"];
RULES_COMMANDS_SEND -> METERS_COMMANDS_SEND [ label="RULES_SYNCHRONIZED"];
METERS_COMMANDS_SEND -> METERS_COMMANDS_SEND [ label="METERS_REMOVED"];
METERS_COMMANDS_SEND -> METERS_COMMANDS_SEND [ label="MISCONFIGURED_METERS_MODIFIED"];
METERS_COMMANDS_SEND -> FINISHED_WITH_ERROR [ label="TIMEOUT"];
METERS_COMMANDS_SEND -> FINISHED_WITH_ERROR [ label="ERROR"];
METERS_COMMANDS_SEND -> FINISHED [ label="NEXT"];
INITIALIZED -> COMPUTE_MISSING_RULES [ label="NEXT"];
COMPUTE_EXCESS_RULES -> FINISHED_WITH_ERROR [ label="ERROR"];
COMPUTE_EXCESS_RULES -> COMPUTE_EXCESS_METERS [ label="NEXT"];
COMPUTE_GROUP_MIRROR_CONFIGS -> FINISHED_WITH_ERROR [ label="ERROR"];
COMPUTE_GROUP_MIRROR_CONFIGS -> COMPUTE_LOGICAL_PORTS_COMMANDS [ label="NEXT"];
COMPUTE_LOGICAL_PORTS_COMMANDS -> FINISHED_WITH_ERROR [ label="ERROR"];
COMPUTE_LOGICAL_PORTS_COMMANDS -> LOGICAL_PORTS_COMMANDS_SEND [ label="NEXT"];
RULES_COMMANDS_SEND -> FINISHED [ label="NEXT"];
COMPUTE_MISSING_RULES -> FINISHED_WITH_ERROR [ label="ERROR"];
COMPUTE_MISSING_RULES -> COMPUTE_MISCONFIGURED_RULES [ label="NEXT"];
COMPUTE_MISCONFIGURED_RULES -> FINISHED_WITH_ERROR [ label="ERROR"];
COMPUTE_MISCONFIGURED_RULES -> COMPUTE_EXCESS_RULES [ label="NEXT"];
COMPUTE_EXCESS_METERS -> FINISHED_WITH_ERROR [ label="ERROR"];
COMPUTE_EXCESS_METERS -> COMPUTE_MISCONFIGURED_METERS [ label="NEXT"];
COMPUTE_MISCONFIGURED_METERS -> FINISHED_WITH_ERROR [ label="ERROR"];
COMPUTE_MISCONFIGURED_METERS -> COMPUTE_GROUP_MIRROR_CONFIGS [ label="NEXT"];}}
COMPUTE_MISCONFIGURED_METERS -> COMPUTE_GROUP_MIRROR_CONFIGS [ label="NEXT"];
COMPUTE_GROUP_MIRROR_CONFIGS -> FINISHED_WITH_ERROR [ label="ERROR"];
COMPUTE_GROUP_MIRROR_CONFIGS -> COMPUTE_LOGICAL_PORTS_COMMANDS [ label="NEXT"];
METERS_COMMANDS_SEND -> METERS_COMMANDS_SEND [ label="METERS_REMOVED"];
METERS_COMMANDS_SEND -> METERS_COMMANDS_SEND [ label="MISCONFIGURED_METERS_MODIFIED"];
METERS_COMMANDS_SEND -> FINISHED_WITH_ERROR [ label="TIMEOUT"];
METERS_COMMANDS_SEND -> FINISHED_WITH_ERROR [ label="ERROR"];
METERS_COMMANDS_SEND -> RULES_COMMANDS_SEND [ label="NEXT"];}}
Binary file modified docs/design/hub-and-spoke/switch-sync/switch-sync-fsm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import static org.openkilda.wfm.topology.switchmanager.fsm.SwitchSyncFsm.SwitchSyncEvent.MISCONFIGURED_RULES_REINSTALLED;
import static org.openkilda.wfm.topology.switchmanager.fsm.SwitchSyncFsm.SwitchSyncEvent.MISSING_RULES_INSTALLED;
import static org.openkilda.wfm.topology.switchmanager.fsm.SwitchSyncFsm.SwitchSyncEvent.NEXT;
import static org.openkilda.wfm.topology.switchmanager.fsm.SwitchSyncFsm.SwitchSyncEvent.RULES_SYNCHRONIZED;
import static org.openkilda.wfm.topology.switchmanager.fsm.SwitchSyncFsm.SwitchSyncEvent.TIMEOUT;
import static org.openkilda.wfm.topology.switchmanager.fsm.SwitchSyncFsm.SwitchSyncState.COMPUTE_EXCESS_METERS;
import static org.openkilda.wfm.topology.switchmanager.fsm.SwitchSyncFsm.SwitchSyncState.COMPUTE_EXCESS_RULES;
Expand Down Expand Up @@ -224,7 +223,18 @@ SwitchSyncEvent, Object> builder() {
builder.externalTransition().from(GROUPS_COMMANDS_SEND).to(FINISHED_WITH_ERROR).on(ERROR)
.callMethod(FINISHED_WITH_ERROR_METHOD_NAME);

builder.externalTransition().from(GROUPS_COMMANDS_SEND).to(RULES_COMMANDS_SEND).on(NEXT)
builder.externalTransition().from(GROUPS_COMMANDS_SEND).to(METERS_COMMANDS_SEND).on(NEXT)
.callMethod("sendMetersCommands");
builder.internalTransition().within(METERS_COMMANDS_SEND).on(METERS_REMOVED).callMethod("meterRemoved");
builder.internalTransition().within(METERS_COMMANDS_SEND).on(MISCONFIGURED_METERS_MODIFIED)
.callMethod("meterModified");

builder.externalTransition().from(METERS_COMMANDS_SEND).to(FINISHED_WITH_ERROR).on(TIMEOUT)
.callMethod(COMMANDS_PROCESSING_FAILED_BY_TIMEOUT_METHOD_NAME);
builder.externalTransition().from(METERS_COMMANDS_SEND).to(FINISHED_WITH_ERROR).on(ERROR)
.callMethod(FINISHED_WITH_ERROR_METHOD_NAME);

builder.externalTransition().from(METERS_COMMANDS_SEND).to(RULES_COMMANDS_SEND).on(NEXT)
.callMethod("sendRulesCommands");
builder.internalTransition().within(RULES_COMMANDS_SEND).on(MISSING_RULES_INSTALLED)
.callMethod("missingRuleInstalled");
Expand All @@ -237,20 +247,8 @@ SwitchSyncEvent, Object> builder() {
.callMethod(COMMANDS_PROCESSING_FAILED_BY_TIMEOUT_METHOD_NAME);
builder.externalTransition().from(RULES_COMMANDS_SEND).to(FINISHED_WITH_ERROR).on(ERROR)
.callMethod(FINISHED_WITH_ERROR_METHOD_NAME);

builder.externalTransition().from(RULES_COMMANDS_SEND).to(METERS_COMMANDS_SEND).on(RULES_SYNCHRONIZED)
.callMethod("sendMetersCommands");
builder.internalTransition().within(METERS_COMMANDS_SEND).on(METERS_REMOVED).callMethod("meterRemoved");
builder.internalTransition().within(METERS_COMMANDS_SEND).on(MISCONFIGURED_METERS_MODIFIED)
.callMethod("meterModified");

builder.externalTransition().from(METERS_COMMANDS_SEND).to(FINISHED_WITH_ERROR).on(TIMEOUT)
.callMethod(COMMANDS_PROCESSING_FAILED_BY_TIMEOUT_METHOD_NAME);
builder.externalTransition().from(METERS_COMMANDS_SEND).to(FINISHED_WITH_ERROR).on(ERROR)
.callMethod(FINISHED_WITH_ERROR_METHOD_NAME);
builder.externalTransition().from(METERS_COMMANDS_SEND).to(FINISHED).on(NEXT)
builder.externalTransition().from(RULES_COMMANDS_SEND).to(FINISHED).on(NEXT)
.callMethod(FINISHED_METHOD_NAME);

return builder;
}

Expand Down Expand Up @@ -342,9 +340,10 @@ protected void computeMisconfiguredMeters(SwitchSyncState from, SwitchSyncState

protected void sendRulesCommands(SwitchSyncState from, SwitchSyncState to,
SwitchSyncEvent event, Object context) {
if (missingRules.isEmpty() && excessRules.isEmpty()) {
if (missingRules.isEmpty() && excessRules.isEmpty() && misconfiguredRules.isEmpty()) {
log.info("Nothing to do with rules (switch={}, key={})", switchId, key);
fire(NEXT);
return;
}

if (!missingRules.isEmpty()) {
Expand Down Expand Up @@ -398,7 +397,6 @@ List<MeterInfoEntry> getModifyFlowMeters() {
ValidateRulesResult validateRulesResult = validationResult.getValidateRulesResult();
return validationResult.getValidateMetersResult().getMisconfiguredMeters().stream()
.filter(meter -> MeterId.isMeterIdOfFlowRule(meter.getMeterId()))
.filter(meter -> !validateRulesResult.getMissingRules().contains(meter.getCookie()))
.collect(Collectors.toList());
}

Expand Down Expand Up @@ -511,6 +509,7 @@ protected void sendLogicalPortsCommandsCommands(SwitchSyncState from, SwitchSync
if (missingLogicalPorts.isEmpty() && excessLogicalPorts.isEmpty()) {
log.info("Nothing to do with logical ports (switch={}, key={})", switchId, key);
fire(NEXT);
return;
}

if (!missingLogicalPorts.isEmpty()) {
Expand Down Expand Up @@ -588,6 +587,7 @@ protected void sendGroupsCommands(SwitchSyncState from, SwitchSyncState to,
if (missingGroups.isEmpty() && misconfiguredGroups.isEmpty() && excessGroups.isEmpty()) {
log.info("Nothing to do with groups (switch={}, key={})", switchId, key);
fire(NEXT);
return;
}

if (!missingGroups.isEmpty()) {
Expand Down Expand Up @@ -648,7 +648,7 @@ private void continueIfRulesSynchronized() {
if (missingRulesPendingResponsesCount == 0
&& excessRulesPendingResponsesCount == 0
&& reinstallDefaultRulesPendingResponsesCount == 0) {
fire(RULES_SYNCHRONIZED);
fire(NEXT);
}
}

Expand Down Expand Up @@ -788,7 +788,6 @@ public enum SwitchSyncEvent {
MISSING_RULES_INSTALLED,
EXCESS_RULES_REMOVED,
MISCONFIGURED_RULES_REINSTALLED,
RULES_SYNCHRONIZED,
METERS_REMOVED,
MISCONFIGURED_METERS_MODIFIED,
GROUPS_INSTALLED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ void process(SwitchSyncFsm fsm) {
SwitchSyncState.RULES_COMMANDS_SEND,
SwitchSyncState.METERS_COMMANDS_SEND,
SwitchSyncState.GROUPS_COMMANDS_SEND,
SwitchSyncState.LOGICAL_PORTS_COMMANDS_SEND,
SwitchSyncState.FINISHED,
SwitchSyncState.FINISHED_WITH_ERROR
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.openkilda.messaging.command.flow.InstallIngressFlow;
import org.openkilda.messaging.command.flow.RemoveFlow;
import org.openkilda.messaging.command.flow.RemoveFlowForSwitchManagerRequest;
import org.openkilda.messaging.command.switches.DeleterMeterForSwitchManagerRequest;
import org.openkilda.messaging.command.switches.SwitchValidateRequest;
import org.openkilda.messaging.error.ErrorData;
import org.openkilda.messaging.error.ErrorMessage;
Expand Down Expand Up @@ -287,13 +288,15 @@ public void handleSyncExcess() {
verify(commandBuilder).buildCommandsToSyncMissingRules(eq(SWITCH_ID), eq(missingRules));
verify(commandBuilder).buildCommandsToRemoveExcessRules(
eq(SWITCH_ID), eq(singletonList(flowEntry)), eq(excessRules));
verify(carrier).sendCommandToSpeaker(eq(KEY), any(DeleterMeterForSwitchManagerRequest.class));

service.handleRemoveMetersResponse(KEY);
verify(carrier).sendCommandToSpeaker(eq(KEY), any(InstallFlowForSwitchManagerRequest.class));
verify(carrier).sendCommandToSpeaker(eq(KEY), any(RemoveFlowForSwitchManagerRequest.class));

service.handleInstallRulesResponse(KEY);
service.handleRemoveRulesResponse(KEY);

service.handleRemoveMetersResponse(KEY);
verify(carrier, times(3)).sendCommandToSpeaker(eq(KEY), any(CommandData.class));

verify(carrier).cancelTimeoutCallback(eq(KEY));
Expand Down
3 changes: 2 additions & 1 deletion src-python/lab-service/lab/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ python-logstash
flask<2.0.0 # flask 2.0.0 is incompatible with click==7.0 from traffexam/requirements.txt
docker<=4.4.4
requests
netifaces==0.11.0
netifaces==0.11.0
MarkupSafe<2.1.0

0 comments on commit 39652d3

Please sign in to comment.