Skip to content

store: add version field to NodeInfo#252

Merged
sravotto merged 1 commit into
mainfrom
sr8_node_vers
Mar 16, 2026
Merged

store: add version field to NodeInfo#252
sravotto merged 1 commit into
mainfrom
sr8_node_vers

Conversation

@sravotto
Copy link
Copy Markdown
Contributor

Allow nodes to report which version of visus they are running, useful for monitoring rolling upgrades.

@sravotto sravotto marked this pull request as ready for review March 13, 2026 18:01
@sravotto sravotto requested a review from BramGruneir March 13, 2026 18:01
Copy link
Copy Markdown

@BramGruneir BramGruneir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but you might want to update how you scan rows, see my comment for details.

Comment thread internal/store/node.go Outdated
for rows.Next() {
var n NodeInfo
if err := rows.Scan(&n.ID, &n.Hostname, &n.PID, &n.Updated); err != nil {
if err := rows.Scan(&n.ID, &n.Hostname, &n.PID, &n.Version, &n.Updated); err != nil {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PGX now has a much nicer version of this, where you can just have it match by name and insert into the struct. It's not more efficient, but it read so much nicer and it should catch any errors when the order changes.

Look for pgx.RowToStructByName

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I keep forget about this.. Done.

Allow nodes to report which version of visus they are running, useful
for monitoring rolling upgrades.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sravotto sravotto merged commit 3adbf40 into main Mar 16, 2026
7 checks passed
@sravotto sravotto deleted the sr8_node_vers branch March 16, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants