Skip to content

Commit

Permalink
applier: store instance_id in struct applier
Browse files Browse the repository at this point in the history
Applier is going to need its numeric ID in order to tell the
future Raft module who is a sender of a Raft message. An
alternative would be to add sender ID to each Raft message, but
this looks like a crutch. Moreover, applier still needs to know
its numeric ID in order to notify Raft about heartbeats from the
peer node.

Needed for #1146
  • Loading branch information
Gerold103 committed Sep 29, 2020
1 parent 9010887 commit 7c14819
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/box/applier.cc
Expand Up @@ -1118,6 +1118,7 @@ applier_subscribe(struct applier *applier)
vclock_create(&applier->remote_vclock_at_subscribe);
xrow_decode_subscribe_response_xc(&row, &cluster_id,
&applier->remote_vclock_at_subscribe);
applier->instance_id = row.replica_id;
/*
* If master didn't send us its cluster id
* assume that it has done all the checks.
Expand Down
2 changes: 2 additions & 0 deletions src/box/applier.h
Expand Up @@ -95,6 +95,8 @@ struct applier {
ev_tstamp lag;
/** The last box_error_code() logged to avoid log flooding */
uint32_t last_logged_errcode;
/** Remote instance ID. */
uint32_t instance_id;
/** Remote instance UUID */
struct tt_uuid uuid;
/** Remote URI (string) */
Expand Down

0 comments on commit 7c14819

Please sign in to comment.