summaryrefslogtreecommitdiff
path: root/ovsdb
diff options
context:
space:
mode:
authorHan Zhou <hzhou8@ebay.com>2019-04-12 16:26:27 -0700
committerBen Pfaff <blp@ovn.org>2019-04-15 13:15:56 -0700
commit7ef3608942f545a880c566e8df75ca3d177a32ad (patch)
tree2e20761038296a579666090949d150a6dab671dd /ovsdb
parenteb6922584c0f86e6ee1528b365a98f918f02a2ee (diff)
downloadopenvswitch-7ef3608942f545a880c566e8df75ca3d177a32ad.tar.gz
ovsdb raft: cmd->eid should always be non-null.
raft_command's eid should always be non-null in all 3 cases. Fix the comment, and also replace if condition with assert. Signed-off-by: Han Zhou <hzhou8@ebay.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'ovsdb')
-rw-r--r--ovsdb/raft.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/ovsdb/raft.c b/ovsdb/raft.c
index abcc9c0e3..02bdf115d 100644
--- a/ovsdb/raft.c
+++ b/ovsdb/raft.c
@@ -108,13 +108,11 @@ struct raft_command {
struct hmap_node hmap_node; /* In struct raft's 'commands' hmap. */
unsigned int n_refs; /* Reference count. */
enum raft_command_status status; /* Execution status. */
+ struct uuid eid; /* Entry ID of result. */
/* Case 1 only. */
uint64_t index; /* Index in log (0 if being relayed). */
- /* Cases 2 and 3. */
- struct uuid eid; /* Entry ID of result. */
-
/* Case 2 only. */
long long int timestamp; /* Issue or last ping time, for expiration. */
@@ -1974,9 +1972,8 @@ raft_command_initiate(struct raft *raft,
}
struct raft_command *cmd = raft_command_create_incomplete(raft, index);
- if (eid) {
- cmd->eid = *eid;
- }
+ ovs_assert(eid);
+ cmd->eid = *eid;
raft_waiter_create(raft, RAFT_W_ENTRY, true)->entry.index = cmd->index;