Skip to content

Commit bbaf1b3

Browse files
craig[bot]kyle-a-wongxinhaoz
committed
143499: ui: add support for all timezones in db console r=kyle-a-wong a=kyle-a-wong Adds a new cluster setting, `ui.default_timezone` to replace `ui.display_timezone` for controlling the timezone of displayed times in db console. This new setting can be set to any valid timezone. `ui.display_timezone` is now deprecated and will be removed in a future version. A new upgrade has also been added to set the value of `ui.default_timezone` to the value of `ui.display_timezone` if it has been updated from the default value. This will ensure that clusters which have set the deprecated `ui.display_timezone` won't experience any regressions when db console switches from using `ui.display_timezone` to `ui.default_timezone`. Epic: [CRDB-43155](https://cockroachlabs.atlassian.net/browse/CRDB-43155) Resolves: [CRDB-48225](https://cockroachlabs.atlassian.net/browse/CRDB-48225) Release note (ui change): A new cluster setting, `ui.default_timezone`, has been added to replace the now deprecated `ui.display_timezone`. This setting has no restrictions on which timezones can set and used to render timestamps in db console. `ui.display_timezone` should no longer be used and will be removed in a future version 143756: sqlstats,insights: remove sessionID param in Observe* fn signatures r=xinhaoz a=xinhaoz This parameter is redundant as we should read the session id from the provided stats object. Epic: none Release note: None Co-authored-by: Kyle Wong <[email protected]> Co-authored-by: Xin Hao Zhang <[email protected]>
3 parents a35d833 + 38133ad + d2a4cf5 commit bbaf1b3

File tree

25 files changed

+359
-83
lines changed

25 files changed

+359
-83
lines changed

docs/generated/settings/settings-for-tenants.txt

+3-2
Original file line numberDiff line numberDiff line change
@@ -407,5 +407,6 @@ trace.snapshot.rate duration 0s if non-zero, interval at which background trace
407407
trace.span_registry.enabled boolean false if set, ongoing traces can be seen at https://<ui>/#/debug/tracez application
408408
trace.zipkin.collector string the address of a Zipkin instance to receive traces, as <host>:<port>. If no port is specified, 9411 will be used. application
409409
ui.database_locality_metadata.enabled boolean true if enabled shows extended locality data about databases and tables in DB Console which can be expensive to compute application
410-
ui.display_timezone enumeration etc/utc the timezone used to format timestamps in the ui [etc/utc = 0, america/new_york = 1] application
411-
version version 1000025.1-upgrading-to-1000025.2-step-004 set the active cluster version in the format '<major>.<minor>' application
410+
ui.default_timezone string the default timezone used to format timestamps in the ui application
411+
ui.display_timezone enumeration etc/utc the timezone used to format timestamps in the ui. This setting is deprecatedand will be removed in a future version. Use the 'ui.default_timezone' setting instead. 'ui.default_timezone' takes precedence over this setting. [etc/utc = 0, america/new_york = 1] application
412+
version version 1000025.1-upgrading-to-1000025.2-step-006 set the active cluster version in the format '<major>.<minor>' application

docs/generated/settings/settings.html

+3-2
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,8 @@
365365
<tr><td><div id="setting-trace-span-registry-enabled" class="anchored"><code>trace.span_registry.enabled</code></div></td><td>boolean</td><td><code>false</code></td><td>if set, ongoing traces can be seen at https://&lt;ui&gt;/#/debug/tracez</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
366366
<tr><td><div id="setting-trace-zipkin-collector" class="anchored"><code>trace.zipkin.collector</code></div></td><td>string</td><td><code></code></td><td>the address of a Zipkin instance to receive traces, as &lt;host&gt;:&lt;port&gt;. If no port is specified, 9411 will be used.</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
367367
<tr><td><div id="setting-ui-database-locality-metadata-enabled" class="anchored"><code>ui.database_locality_metadata.enabled</code></div></td><td>boolean</td><td><code>true</code></td><td>if enabled shows extended locality data about databases and tables in DB Console which can be expensive to compute</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
368-
<tr><td><div id="setting-ui-display-timezone" class="anchored"><code>ui.display_timezone</code></div></td><td>enumeration</td><td><code>etc/utc</code></td><td>the timezone used to format timestamps in the ui [etc/utc = 0, america/new_york = 1]</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
369-
<tr><td><div id="setting-version" class="anchored"><code>version</code></div></td><td>version</td><td><code>1000025.1-upgrading-to-1000025.2-step-004</code></td><td>set the active cluster version in the format &#39;&lt;major&gt;.&lt;minor&gt;&#39;</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
368+
<tr><td><div id="setting-ui-default-timezone" class="anchored"><code>ui.default_timezone</code></div></td><td>string</td><td><code></code></td><td>the default timezone used to format timestamps in the ui</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
369+
<tr><td><div id="setting-ui-display-timezone" class="anchored"><code>ui.display_timezone</code></div></td><td>enumeration</td><td><code>etc/utc</code></td><td>the timezone used to format timestamps in the ui. This setting is deprecatedand will be removed in a future version. Use the &#39;ui.default_timezone&#39; setting instead. &#39;ui.default_timezone&#39; takes precedence over this setting. [etc/utc = 0, america/new_york = 1]</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
370+
<tr><td><div id="setting-version" class="anchored"><code>version</code></div></td><td>version</td><td><code>1000025.1-upgrading-to-1000025.2-step-006</code></td><td>set the active cluster version in the format &#39;&lt;major&gt;.&lt;minor&gt;&#39;</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
370371
</tbody>
371372
</table>

pkg/clusterversion/cockroach_versions.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,8 @@ const (
227227

228228
V25_2_AddSqlActivityFlushJob
229229

230+
V25_2_SetUiDefaultTimezoneSetting
231+
230232
// *************************************************
231233
// Step (1) Add new versions above this comment.
232234
// Do not add new versions to a patch release.
@@ -278,8 +280,9 @@ var versionTable = [numKeys]roachpb.Version{
278280
V25_1: {Major: 25, Minor: 1, Internal: 0},
279281

280282
// v25.2 versions. Internal versions must be even.
281-
V25_2_Start: {Major: 25, Minor: 1, Internal: 2},
282-
V25_2_AddSqlActivityFlushJob: {Major: 25, Minor: 1, Internal: 4},
283+
V25_2_Start: {Major: 25, Minor: 1, Internal: 2},
284+
V25_2_AddSqlActivityFlushJob: {Major: 25, Minor: 1, Internal: 4},
285+
V25_2_SetUiDefaultTimezoneSetting: {Major: 25, Minor: 1, Internal: 6},
283286

284287
// *************************************************
285288
// Step (2): Add new versions above this comment.

pkg/sql/catalog/bootstrap/testdata/testdata

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
system hash=594e3fbde512dd058e06f2d4924d08774b8fe41d67025ccc098f0eb051990681
1+
system hash=7c77a643e86cfe4d034a2ffb99167fad8694f9f950cd28ba24817ff52528cee9
22
----
33
[{"key":"8b"}
4-
,{"key":"8b89898a89","value":"0312470a0673797374656d10011a250a0d0a0561646d696e1080101880100a0c0a04726f6f7410801018801012046e6f646518032200280140004a006a0a08d9843d1001180020047000"}
4+
,{"key":"8b89898a89","value":"0312470a0673797374656d10011a250a0d0a0561646d696e1080101880100a0c0a04726f6f7410801018801012046e6f646518032200280140004a006a0a08d9843d1001180020067000"}
55
,{"key":"8b898b8a89","value":"030aa0030a0a64657363726970746f721803200128013a0042270a02696410011a0c08011040180030005014600020003000680070007800800100880100980100422f0a0a64657363726970746f7210021a0c08081000180030005011600020013000680070007800800100880100980100480352740a077072696d61727910011801220269642a0a64657363726970746f72300140004a10080010001a00200028003000380040005a0070027a0408002000800100880100900104980101a20106080012001800a80100b20100ba0100c00100c80100d00101e00100e9010000000000000000f2010060026a210a0b0a0561646d696e102018200a0a0a04726f6f741020182012046e6f64651803800101880103980100b201130a077072696d61727910001a02696420012800b201240a1066616d5f325f64657363726970746f7210021a0a64657363726970746f7220022802b80103c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880302a80300b00300d00300d80300e00300f80300880400980400a00400a80400"}
66
,{"key":"8b898c8a89","value":"030adc050a0575736572731804200128013a00422d0a08757365726e616d6510011a0c0807100018003000501960002000300068007000780080010088010098010042330a0e68617368656450617373776f726410021a0c0808100018003000501160002001300068007000780080010088010098010042320a066973526f6c6510031a0c08001000180030005010600020002a0566616c73653000680070007800800100880100980100422c0a07757365725f696410041a0c080c100018003000501a60002000300068007000780080010088010098010048055293010a077072696d617279100118012208757365726e616d652a0e68617368656450617373776f72642a066973526f6c652a07757365725f6964300140004a10080010001a00200028003000380040005a007002700370047a0408002000800100880100900104980101a20106080012001800a80100b20100ba0100c00100c80100d00102e00100e9010000000000000000f201005a770a1175736572735f757365725f69645f696478100218012207757365725f69643004380140004a10080010001a00200028003000380040005a007a0408002000800100880100900103980100a20106080012001800a80100b20100ba0100c00100c80100d00101e00100e9010000000000000000f2010060036a250a0d0a0561646d696e10e00318e0030a0c0a04726f6f7410e00318e00312046e6f64651803800101880103980100b201240a077072696d61727910001a08757365726e616d651a07757365725f6964200120042804b2012c0a1466616d5f325f68617368656450617373776f726410021a0e68617368656450617373776f726420022802b2011c0a0c66616d5f335f6973526f6c6510031a066973526f6c6520032803b80104c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880303a80300b00300d00300d80300e00300f80300880400980400a00400a80400"}
77
,{"key":"8b898d8a89","value":"030a8f030a057a6f6e65731805200128013a0042270a02696410011a0c08011040180030005014600020003000680070007800800100880100980100422b0a06636f6e66696710021a0c08081000180030005011600020013000680070007800800100880100980100480352700a077072696d61727910011801220269642a06636f6e666967300140004a10080010001a00200028003000380040005a0070027a0408002000800100880100900104980101a20106080012001800a80100b20100ba0100c00100c80100d00101e00100e9010000000000000000f2010060026a250a0d0a0561646d696e10e00318e0030a0c0a04726f6f7410e00318e00312046e6f64651803800101880103980100b201130a077072696d61727910001a02696420012800b2011c0a0c66616d5f325f636f6e66696710021a06636f6e66696720022802b80103c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880302a80300b00300d00300d80300e00300f80300880400980400a00400a80400"}
@@ -213,10 +213,10 @@ system hash=594e3fbde512dd058e06f2d4924d08774b8fe41d67025ccc098f0eb051990681
213213
,{"key":"d0"}
214214
]
215215

216-
tenant hash=8d28a6a45b97e05312c013d50318bbb60e830e6c2e001a4ed1c451f7184d5fdb
216+
tenant hash=ae1f9d8fc1a1ad8d180b5168a11774fcab532f822a59108db46164414c8297ca
217217
----
218218
[{"key":""}
219-
,{"key":"8b89898a89","value":"0312470a0673797374656d10011a250a0d0a0561646d696e1080101880100a0c0a04726f6f7410801018801012046e6f646518032200280140004a006a0a08d9843d1001180020047000"}
219+
,{"key":"8b89898a89","value":"0312470a0673797374656d10011a250a0d0a0561646d696e1080101880100a0c0a04726f6f7410801018801012046e6f646518032200280140004a006a0a08d9843d1001180020067000"}
220220
,{"key":"8b898b8a89","value":"030aa0030a0a64657363726970746f721803200128013a0042270a02696410011a0c08011040180030005014600020003000680070007800800100880100980100422f0a0a64657363726970746f7210021a0c08081000180030005011600020013000680070007800800100880100980100480352740a077072696d61727910011801220269642a0a64657363726970746f72300140004a10080010001a00200028003000380040005a0070027a0408002000800100880100900104980101a20106080012001800a80100b20100ba0100c00100c80100d00101e00100e9010000000000000000f2010060026a210a0b0a0561646d696e102018200a0a0a04726f6f741020182012046e6f64651803800101880103980100b201130a077072696d61727910001a02696420012800b201240a1066616d5f325f64657363726970746f7210021a0a64657363726970746f7220022802b80103c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880302a80300b00300d00300d80300e00300f80300880400980400a00400a80400"}
221221
,{"key":"8b898c8a89","value":"030adc050a0575736572731804200128013a00422d0a08757365726e616d6510011a0c0807100018003000501960002000300068007000780080010088010098010042330a0e68617368656450617373776f726410021a0c0808100018003000501160002001300068007000780080010088010098010042320a066973526f6c6510031a0c08001000180030005010600020002a0566616c73653000680070007800800100880100980100422c0a07757365725f696410041a0c080c100018003000501a60002000300068007000780080010088010098010048055293010a077072696d617279100118012208757365726e616d652a0e68617368656450617373776f72642a066973526f6c652a07757365725f6964300140004a10080010001a00200028003000380040005a007002700370047a0408002000800100880100900104980101a20106080012001800a80100b20100ba0100c00100c80100d00102e00100e9010000000000000000f201005a770a1175736572735f757365725f69645f696478100218012207757365725f69643004380140004a10080010001a00200028003000380040005a007a0408002000800100880100900103980100a20106080012001800a80100b20100ba0100c00100c80100d00101e00100e9010000000000000000f2010060036a250a0d0a0561646d696e10e00318e0030a0c0a04726f6f7410e00318e00312046e6f64651803800101880103980100b201240a077072696d61727910001a08757365726e616d651a07757365725f6964200120042804b2012c0a1466616d5f325f68617368656450617373776f726410021a0e68617368656450617373776f726420022802b2011c0a0c66616d5f335f6973526f6c6510031a066973526f6c6520032803b80104c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880303a80300b00300d00300d80300e00300f80300880400980400a00400a80400"}
222222
,{"key":"8b898d8a89","value":"030a8f030a057a6f6e65731805200128013a0042270a02696410011a0c08011040180030005014600020003000680070007800800100880100980100422b0a06636f6e66696710021a0c08081000180030005011600020013000680070007800800100880100980100480352700a077072696d61727910011801220269642a06636f6e666967300140004a10080010001a00200028003000380040005a0070027a0408002000800100880100900104980101a20106080012001800a80100b20100ba0100c00100c80100d00101e00100e9010000000000000000f2010060026a250a0d0a0561646d696e10e00318e0030a0c0a04726f6f7410e00318e00312046e6f64651803800101880103980100b201130a077072696d61727910001a02696420012800b2011c0a0c66616d5f325f636f6e66696710021a06636f6e66696720022802b80103c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880302a80300b00300d00300d80300e00300f80300880400980400a00400a80400"}

pkg/sql/catalog/systemschema/system.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1375,7 +1375,7 @@ const SystemDatabaseName = catconstants.SystemDatabaseName
13751375
// release version).
13761376
//
13771377
// NB: Don't set this to clusterversion.Latest; use a specific version instead.
1378-
var SystemDatabaseSchemaBootstrapVersion = clusterversion.V25_2_AddSqlActivityFlushJob.Version()
1378+
var SystemDatabaseSchemaBootstrapVersion = clusterversion.V25_2_SetUiDefaultTimezoneSetting.Version()
13791379

13801380
// MakeSystemDatabaseDesc constructs a copy of the system database
13811381
// descriptor.

0 commit comments

Comments
 (0)