Skip to content

ENG-881: Ignore proposals/accepts until restore complete #180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions polybase/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,11 +447,19 @@ async fn main() -> Result<()> {
}

NetworkEvent::Accept { accept } => {
if snapshot_from.is_some() {
continue;
}

info!(height = &accept.height, skips = &accept.skips, from = &from_peer_id.prefix(), leader = &accept.leader_id.prefix(), hash = accept.proposal_hash.to_string(), local_height = solid.height(), "Received accept");
solid.receive_accept(&accept, &from_peer_id);
}

NetworkEvent::Proposal { manifest } => {
if snapshot_from.is_some() {
continue;
}

info!(height = &manifest.height, skips = &manifest.skips, from = &from_peer_id.prefix(), leader = &manifest.leader_id.prefix(), hash = &manifest.hash().to_string(), "Received proposal");

// Lease the proposal changes
Expand All @@ -463,6 +471,10 @@ async fn main() -> Result<()> {
}

NetworkEvent::Txn { txn } => {
if snapshot_from.is_some() {
continue;
}

info!(collection = &txn.collection_id, "Received txn");
match db.add_txn(txn).await {
Ok(_) => (),
Expand Down
4 changes: 2 additions & 2 deletions polybase/src/network/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ impl Network {
}
match swarm.behaviour_mut().rr.send_response(channel, protocol::Response) {
Ok(_) => {},
Err(_) => {
error!(peer_id = ?peer, "Failed to send response");
Err(err) => {
error!(peer_id = ?peer, "Failed to send response: {:?}", err);
}
}
}
Expand Down