Skip to content

Commit 23d2948

Browse files
committed
roachtest: elide 'estimated_last_login_time' in system.users fingerprint
The backup/restore roachtests have recently begun to flake (due to #150375) with a fingerprint error on the system.users table. The roachtest simply needs to be taught to elide the values of the estimated_last_login_time column, which can be updated before the test driver fingerprints the column. Fixes #150400 Release note: none
1 parent ec83247 commit 23d2948

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

pkg/cmd/roachtest/tests/mixed_version_backup.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -842,6 +842,17 @@ func (sc *systemTableContents) scheduledJobsHandler(
842842
Values()
843843
}
844844

845+
// usersHandler replaces the contents of "estimated_last_login_time" which gets
846+
// updated on every user login attempt, which means the post restore fingerprint
847+
// could observe an updated log in time value.
848+
func (sc *systemTableContents) usersHandler(
849+
values []interface{}, columns []string,
850+
) ([]interface{}, error) {
851+
return newSystemTableRow(sc.table, values, columns).
852+
WithSentinel("estimated_last_login_time").
853+
Values()
854+
}
855+
845856
func (sc *systemTableContents) commentsHandler(
846857
values []interface{}, columns []string,
847858
) ([]interface{}, error) {
@@ -879,6 +890,8 @@ func (sc *systemTableContents) handleSpecialCases(
879890
return sc.commentsHandler(row, columns)
880891
case "system.tenant_settings":
881892
return sc.tenantSettingsHandler(row, columns)
893+
case "system.users":
894+
return sc.usersHandler(row, columns)
882895
default:
883896
return row, nil
884897
}

0 commit comments

Comments
 (0)