Skip to content

Commit e5b999c

Browse files
committed
End transaction if a participand disconnects from DTMD.
1 parent 006a3df commit e5b999c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

contrib/pg_dtm/dtmd/src/main.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,12 @@ static void ondisconnect(client_t client) {
167167

168168
if ((t = CLIENT_XPART(client))) {
169169
transaction_remove_listener(t, 's', client);
170-
if (use_raft && (raft.role == ROLE_LEADER)) {
171-
raft_emit(&raft, NEGATIVE, t->xid);
170+
if (use_raft) {
171+
if (raft.role == ROLE_LEADER) {
172+
raft_emit(&raft, NEGATIVE, t->xid);
173+
}
174+
} else {
175+
apply_clog_update(NEGATIVE, t->xid);
172176
}
173177
}
174178

0 commit comments

Comments
 (0)