Skip to content

Commit

Permalink
coord: check while dropping error'd sink connector
Browse files Browse the repository at this point in the history
  • Loading branch information
maddyblue committed Jul 27, 2021
1 parent 67e931b commit 4a94ad2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/coord/src/coord.rs
Original file line number Diff line number Diff line change
Expand Up @@ -687,9 +687,12 @@ impl Coordinator {
tx.send(Ok(ExecuteResponse::CreatedSink { existed: false }), session);
}
Err(e) => {
self.catalog_transact(vec![catalog::Op::DropItem(id)])
.await
.expect("deleting placeholder sink cannot fail");
// Drop the placeholder sink if still present.
if self.catalog.try_get_by_id(id).is_some() {
self.catalog_transact(vec![catalog::Op::DropItem(id)])
.await
.expect("deleting placeholder sink cannot fail");
}
tx.send(Err(e), session);
}
}
Expand Down

0 comments on commit 4a94ad2

Please sign in to comment.