p4lang / p4runtime

Specification documents for the P4Runtime control-plane API
Apache License 2.0
144 stars 88 forks source link

Clarify persistence requirements for "election_id_past" in section 5.3 #330

Closed bocon13 closed 3 years ago

bocon13 commented 3 years ago

The spec is a little vague:

Let election_id_past be the highest election ID the server has ever seen for the given device_id and role_id (including the one of the current primary if there is one).

For correctness, election_id_past should probably be persistent across reboots. This may be particularly important in cases of non-stop forwarding or warm reboot. However, we might be able to relax the constraint in cold reboot cases or other scenarios where forwarding is disrupted.

We should clarify the requirement and include some guidelines in the spec.

cc: @pudelkoM @kuujo

stefanheule commented 3 years ago

Don't we already have text to clarify that?

This invariant must be maintained across in-service software upgrades, and the P4Runtime server must remember the highest election_id after such a restart. However, across a full restart, the election_id must be reset. In fact, a full restart is the only way to reset the election_id.

bocon13 commented 3 years ago

@stefanheule Ah, thanks! I remembered some discussion, but didn't look for it in the right place.