Skip to content
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

Do not crash when locations are null(!) #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
15 changes: 11 additions & 4 deletions bin/manatee-adm
Original file line number Diff line number Diff line change
Expand Up @@ -1277,6 +1277,13 @@ function printClusterTable(opts, columns, cs) {
});
}

function stringifyLsn(s) {
if (s == null) {
return '-';
}
return s;
}

/*
* Returns an object describing a single peer, where the fields of the object
* correspond to the node-tab column names.
Expand Down Expand Up @@ -1313,10 +1320,10 @@ function rowForPeer(columns, role, peer) {
}

rv['REPL'] = peer.pgp_repl.sync_state;
rv['SENT'] = peer.pgp_repl.sent_location;
rv['WRITE'] = peer.pgp_repl.write_location;
rv['FLUSH'] = peer.pgp_repl.flush_location;
rv['REPLAY'] = peer.pgp_repl.replay_location;
rv['SENT'] = stringifyLsn(peer.pgp_repl.sent_location);
rv['WRITE'] = stringifyLsn(peer.pgp_repl.write_location);
rv['FLUSH'] = stringifyLsn(peer.pgp_repl.flush_location);
rv['REPLAY'] = stringifyLsn(peer.pgp_repl.replay_location);
return (rv);
}

Expand Down