Skip to content

Commit 02f8de2

Browse files
craig[bot]kyle-a-wongmsbutlerjbowensrafiss
committed
149596: Reapply "sql,log: add new txn_read_timestamp field to CommonSqlEventDetails" r=kyle-a-wong a=kyle-a-wong This reverts commit e8c121ebeb622c0c414b23a4dd79e67b2a726b00. This commit was reverted because it introduced flaky tests due to non-deterministic queries in the event log logic tests. These flaky queries were updated to order results deterministically. Epic: None Release note: None 149839: ui: refactor schema insights to remove redux and sagas r=kyle-a-wong a=kyle-a-wong Refactors the schema insights component to no longer require redux and sagags. It now uses `useSwr` for data fetching. In order to remove the dependency on redux and sagas, some functionality was removed from this component. This functionality is: 1. dispatching analytics.track actions 2. persisting table sorting and filtering to browser session storage. The analytics.track actions were used in cloud console to track when the table is sorted or a filter is applied. We decided this doesn't provide very much value to replace and removed it. Epic: None Release note: None --- Note: This is a stacked PR, only the last commit needs to be reviewed. 149986: clusterversion: remove obs TODO_Delete_V25_2 versions r=kyle-a-wong a=kyle-a-wong Resolves: #147776 Release note: None 150448: roachtest: bump upgrade timeout in jobs/mixed-version r=jeffswenson a=msbutler We've seen a few runs of this roachtest time out even though the migration is happily chugging along. This patch bumps the timeout from 30 minutes to an hour. Informs #146508 Informs #150104 Release note: none 150491: roachtest: elide 'estimated_last_login_time' in system.users fingerprint r=jeffswenson a=msbutler 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 Fixes #149316 Fixes #150471 Fixes #150472 Fixes #150399 Release note: none 150492: go.mod: bump Pebble to 273e26653683 r=RaduBerinde a=jbowens Changes: * [`273e2665`](cockroachdb/pebble@273e2665) sstable: prevent block metadata pointers to garbage * [`136248c7`](cockroachdb/pebble@136248c7) manual: expand useGoAllocation's comment * [`2fa01831`](cockroachdb/pebble@2fa01831) db: check FormatExciseBoundsRecord against the current format version * [`7a51062c`](cockroachdb/pebble@7a51062c) manual: sometimes mangle freed buffers in invariants builds * [`6b27daec`](cockroachdb/pebble@6b27daec) db: add leaktest to compaction unit tests * [`83f68e05`](cockroachdb/pebble@83f68e05) pebble: close the manifest file on Open failure * [`9685dbe8`](cockroachdb/pebble@9685dbe8) sstable: mangle some more buffers in invariants builds * [`ab5eeb98`](cockroachdb/pebble@ab5eeb98) metamorphic: propagate FS changes to TestOptions * [`f2a76e85`](cockroachdb/pebble@f2a76e85) db: deflake TestCompactionCorruption * [`bf6aaa56`](cockroachdb/pebble@bf6aaa56) github: stress new unit tests in PRs * [`ffd01fd1`](cockroachdb/pebble@ffd01fd1) manifest: explicitly encode excise operations in the MANIFEST * [`e1bc7c50`](cockroachdb/pebble@e1bc7c50) pebble: fix TestOpenAlreadyLocked Close #149955. Close #150216. Release note: none. Epic: none. 150510: workload/schemachange: don't use CITEXT in mixed version cluster r=rafiss a=rafiss fixes #148980 fixes #150133 Release note: None Co-authored-by: Kyle Wong <[email protected]> Co-authored-by: Michael Butler <[email protected]> Co-authored-by: Jackson Owens <[email protected]> Co-authored-by: Rafi Shamim <[email protected]>
8 parents 8987f66 + 58ef7bf + edf1b33 + bc5ea0c + 08404cd + 23d2948 + d3670fc + 4dbf560 commit 02f8de2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+514
-907
lines changed

DEPS.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,10 +1835,10 @@ def go_deps():
18351835
patches = [
18361836
"@com_github_cockroachdb_cockroach//build/patches:com_github_cockroachdb_pebble.patch",
18371837
],
1838-
sha256 = "b854ba6802c929910b6c5c2572bf9b8b408e1d4cb80db9c62af8fc19fc74dd14",
1839-
strip_prefix = "github.com/cockroachdb/[email protected]20250711175034-837c19b81bab",
1838+
sha256 = "dc82ab51494c5580be75fd82dfefd78b17ce7868d21ff9c44f4feecc71a56de9",
1839+
strip_prefix = "github.com/cockroachdb/[email protected]20250717215536-273e26653683",
18401840
urls = [
1841-
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20250711175034-837c19b81bab.zip",
1841+
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20250717215536-273e26653683.zip",
18421842
],
18431843
)
18441844
go_repository(

build/bazelutil/distdir_files.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ DISTDIR_FILES = {
358358
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/gostdlib/com_github_cockroachdb_gostdlib-v1.19.0.zip": "c4d516bcfe8c07b6fc09b8a9a07a95065b36c2855627cb3514e40c98f872b69e",
359359
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/logtags/com_github_cockroachdb_logtags-v0.0.0-20241215232642-bb51bb14a506.zip": "920068af09e3846d9ebb4e4a7787ff1dd10f3989c5f940ad861b0f6a9f824f6e",
360360
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/metamorphic/com_github_cockroachdb_metamorphic-v0.0.0-20231108215700-4ba948b56895.zip": "28c8cf42192951b69378cf537be5a9a43f2aeb35542908cc4fe5f689505853ea",
361-
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20250711175034-837c19b81bab.zip": "b854ba6802c929910b6c5c2572bf9b8b408e1d4cb80db9c62af8fc19fc74dd14",
361+
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20250717215536-273e26653683.zip": "dc82ab51494c5580be75fd82dfefd78b17ce7868d21ff9c44f4feecc71a56de9",
362362
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/redact/com_github_cockroachdb_redact-v1.1.6.zip": "018eccb5fb9ca52d43ec9eaf213539d01c1f2b94e0e822406ebfb2e9321ef6cf",
363363
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/returncheck/com_github_cockroachdb_returncheck-v0.0.0-20200612231554-92cdbca611dd.zip": "ce92ba4352deec995b1f2eecf16eba7f5d51f5aa245a1c362dfe24c83d31f82b",
364364
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/stress/com_github_cockroachdb_stress-v0.0.0-20220803192808-1806698b1b7b.zip": "3fda531795c600daf25532a4f98be2a1335cd1e5e182c72789bca79f5f69fcc1",

docs/generated/eventlog.md

Lines changed: 83 additions & 0 deletions
Large diffs are not rendered by default.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ require (
140140
github.com/cockroachdb/go-test-teamcity v0.0.0-20191211140407-cff980ad0a55
141141
github.com/cockroachdb/gostdlib v1.19.0
142142
github.com/cockroachdb/logtags v0.0.0-20241215232642-bb51bb14a506
143-
github.com/cockroachdb/pebble v0.0.0-20250711175034-837c19b81bab
143+
github.com/cockroachdb/pebble v0.0.0-20250717215536-273e26653683
144144
github.com/cockroachdb/redact v1.1.6
145145
github.com/cockroachdb/returncheck v0.0.0-20200612231554-92cdbca611dd
146146
github.com/cockroachdb/stress v0.0.0-20220803192808-1806698b1b7b

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,8 +582,8 @@ github.com/cockroachdb/logtags v0.0.0-20241215232642-bb51bb14a506 h1:ASDL+UJcILM
582582
github.com/cockroachdb/logtags v0.0.0-20241215232642-bb51bb14a506/go.mod h1:Mw7HqKr2kdtu6aYGn3tPmAftiP3QPX63LdK/zcariIo=
583583
github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895 h1:XANOgPYtvELQ/h4IrmPAohXqe2pWA8Bwhejr3VQoZsA=
584584
github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895/go.mod h1:aPd7gM9ov9M8v32Yy5NJrDyOcD8z642dqs+F0CeNXfA=
585-
github.com/cockroachdb/pebble v0.0.0-20250711175034-837c19b81bab h1:TL4dKn78L2rqTb2bOMnLJjYoyx7NQUOyi/BD0UDYAjo=
586-
github.com/cockroachdb/pebble v0.0.0-20250711175034-837c19b81bab/go.mod h1:LLa+I2vZrOsrsy4QcuZ6wSXBNQll7erNg3GCr8NpE90=
585+
github.com/cockroachdb/pebble v0.0.0-20250717215536-273e26653683 h1:MZ0Sqn8yxrgOtLw2rAGSlgzNMDkFzc86nOa7mUjALyc=
586+
github.com/cockroachdb/pebble v0.0.0-20250717215536-273e26653683/go.mod h1:LLa+I2vZrOsrsy4QcuZ6wSXBNQll7erNg3GCr8NpE90=
587587
github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg=
588588
github.com/cockroachdb/redact v1.1.6 h1:zXJBwDZ84xJNlHl1rMyCojqyIxv+7YUpQiJLQ7n4314=
589589
github.com/cockroachdb/redact v1.1.6/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg=

pkg/ccl/logictestccl/testdata/logic_test/multi_region

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1097,7 +1097,7 @@ ALTER DATABASE drop_region_db DROP REGION IF EXISTS "us-east-1"
10971097

10981098
# Ensure that events are generated for dropping the region
10991099
query IT
1100-
SELECT "reportingID", info::JSONB - 'Timestamp' - 'DescriptorID'
1100+
SELECT "reportingID", info::JSONB - 'Timestamp' - 'DescriptorID' - 'TxnReadTimestamp'
11011101
FROM system.eventlog
11021102
WHERE "eventType" = 'alter_database_drop_region'
11031103
----

pkg/clusterversion/cockroach_versions.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,6 @@ const (
205205

206206
TODO_Delete_V25_2_Start
207207

208-
TODO_Delete_V25_2_AddSqlActivityFlushJob
209-
210-
TODO_Delete_V25_2_SetUiDefaultTimezoneSetting
211-
212208
// V25_2 is CockroachDB v25.2. It's used for all v25.2.x patch releases.
213209
V25_2
214210

@@ -277,9 +273,7 @@ var versionTable = [numKeys]roachpb.Version{
277273
V25_1: {Major: 25, Minor: 1, Internal: 0},
278274

279275
// v25.2 versions. Internal versions must be even.
280-
TODO_Delete_V25_2_Start: {Major: 25, Minor: 1, Internal: 2},
281-
TODO_Delete_V25_2_AddSqlActivityFlushJob: {Major: 25, Minor: 1, Internal: 4},
282-
TODO_Delete_V25_2_SetUiDefaultTimezoneSetting: {Major: 25, Minor: 1, Internal: 6},
276+
TODO_Delete_V25_2_Start: {Major: 25, Minor: 1, Internal: 2},
283277

284278
V25_2: {Major: 25, Minor: 2, Internal: 0},
285279

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
}

pkg/cmd/roachtest/tests/mixed_version_jobs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func runJobsMixedVersions(ctx context.Context, t test.Test, c cluster.Cluster) {
4242
mvt := mixedversion.NewTest(
4343
ctx, t, t.L(), c, c.All(),
4444
mixedversion.NumUpgrades(2),
45-
mixedversion.UpgradeTimeout(time.Minute*30),
45+
mixedversion.UpgradeTimeout(time.Hour),
4646
mixedversion.MinimumSupportedVersion("v24.3.0"),
4747
mixedversion.AlwaysUseLatestPredecessors,
4848
mixedversion.NeverUseFixtures,

pkg/sql/event_log.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,8 @@ func logEventInternalForSQLStatements(
247247
) error {
248248
// Inject the common fields into the payload provided by the caller.
249249
injectCommonFields := func(event logpb.EventPayload) error {
250-
if txn == nil {
251-
// No txn is set (e.g. for COPY or BEGIN), so use now instead.
252-
event.CommonDetails().Timestamp = timeutil.Now().UnixNano()
253-
} else {
254-
event.CommonDetails().Timestamp = txn.KV().ReadTimestamp().WallTime
255-
}
250+
event.CommonDetails().Timestamp = timeutil.Now().UnixNano()
251+
256252
sqlCommon, ok := event.(eventpb.EventWithCommonSQLPayload)
257253
if !ok {
258254
return errors.AssertionFailedf("unknown event type: %T", event)
@@ -278,6 +274,10 @@ func logEventInternalForSQLStatements(
278274
// Overwrite with the common details.
279275
*m = commonSQLEventDetails
280276

277+
if txn != nil {
278+
m.TxnReadTimestamp = txn.KV().ReadTimestamp().WallTime
279+
}
280+
281281
// If the common details didn't have a descriptor ID, keep the
282282
// one that was in the event already.
283283
if m.DescriptorID == 0 {

0 commit comments

Comments
 (0)