Skip to content

Commit 8ad63ef

Browse files
sql: add system.vcpu_usage table (#170328)
sql: add system.vcpu_usage table
2 parents bb2461a + a5d2d56 commit 8ad63ef

53 files changed

Lines changed: 424 additions & 180 deletions

Some content is hidden

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,4 +449,4 @@ trace.zipkin.collector string the address of a Zipkin instance to receive trace
449449
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
450450
ui.default_timezone string the default timezone used to format timestamps in the ui application
451451
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
452-
version version 1000026.2-upgrading-to-1000026.3-step-014 set the active cluster version in the format '<major>.<minor>' application
452+
version version 1000026.2-upgrading-to-1000026.3-step-016 set the active cluster version in the format '<major>.<minor>' application

docs/generated/settings/settings.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,6 @@
410410
<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>Basic/Standard/Advanced/Self-Hosted</td></tr>
411411
<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>Basic/Standard/Advanced/Self-Hosted</td></tr>
412412
<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>Basic/Standard/Advanced/Self-Hosted</td></tr>
413-
<tr><td><div id="setting-version" class="anchored"><code>version</code></div></td><td>version</td><td><code>1000026.2-upgrading-to-1000026.3-step-014</code></td><td>set the active cluster version in the format &#39;&lt;major&gt;.&lt;minor&gt;&#39;</td><td>Basic/Standard/Advanced/Self-Hosted</td></tr>
413+
<tr><td><div id="setting-version" class="anchored"><code>version</code></div></td><td>version</td><td><code>1000026.2-upgrading-to-1000026.3-step-016</code></td><td>set the active cluster version in the format &#39;&lt;major&gt;.&lt;minor&gt;&#39;</td><td>Basic/Standard/Advanced/Self-Hosted</td></tr>
414414
</tbody>
415415
</table>

pkg/backup/full_cluster_backup_restore_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,7 @@ func TestClusterRestoreFailCleanup(t *testing.T) {
724724
{"tenant_settings"},
725725
{"ui"},
726726
{"users"},
727+
{"vcpu_usage"},
727728
{"zones"},
728729
},
729730
)
@@ -822,6 +823,7 @@ func TestClusterRestoreFailCleanup(t *testing.T) {
822823
{"tenant_settings"},
823824
{"ui"},
824825
{"users"},
826+
{"vcpu_usage"},
825827
{"zones"},
826828
},
827829
)

pkg/backup/system_schema.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -989,6 +989,9 @@ var systemTableBackupConfiguration = map[string]systemBackupConfiguration{
989989
// Restore after system.resource_groups so we can read max(id).
990990
restoreInOrder: 1,
991991
},
992+
systemschema.VcpuUsageTable.GetName(): {
993+
shouldIncludeInClusterBackup: optInToClusterBackup,
994+
},
992995
}
993996

994997
func resourceGroupIDSeqRestoreFunc(

pkg/backup/testdata/backup-restore/external-connections-nodelocal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ statements table full
5858
system database full
5959
ui table full
6060
users table full
61+
vcpu_usage table full
6162
zones table full
6263

6364
# Database backup.

pkg/backup/testdata/backup-restore/external-connections-userfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ ui table full
6060
userfiles_root_upload_files table full
6161
userfiles_root_upload_payload table full
6262
users table full
63+
vcpu_usage table full
6364
zones table full
6465

6566
# Database backup.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
debug doctor examine cluster
22
----
33
debug doctor examine cluster
4-
Examining 79 descriptors and 78 namespace entries...
4+
Examining 80 descriptors and 79 namespace entries...
55
ParentID 100, ParentSchemaID 101: relation "foo" (105): expected matching namespace entry, found none
66
Examining 12 jobs...
77
ERROR: validation failed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
debug doctor examine cluster
22
----
33
debug doctor examine cluster
4-
Examining 78 descriptors and 78 namespace entries...
4+
Examining 79 descriptors and 79 namespace entries...
55
Examining 10 jobs...
66
No problems found!

pkg/cli/testdata/doctor/test_examine_cluster_jobs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
debug doctor examine cluster
22
----
33
debug doctor examine cluster
4-
Examining 78 descriptors and 79 namespace entries...
4+
Examining 79 descriptors and 80 namespace entries...
55
ParentID 183, ParentSchemaID 381: relation "foo" (104): referenced database ID 183: referenced descriptor not found
66
ParentID 183, ParentSchemaID 381: relation "foo" (104): referenced schema ID 381: referenced descriptor not found
77
ParentID 183, ParentSchemaID 381: relation "foo" (104): expected matching namespace entry, found none

pkg/cli/zip_table_registry.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,6 +1302,7 @@ var disabledSystemTables = map[string]struct{}{
13021302
"system.transaction_statistics": {},
13031303
"system.ui": {},
13041304
"system.users": {},
1305+
"system.vcpu_usage": {},
13051306
"system.web_sessions": {},
13061307
}
13071308

0 commit comments

Comments
 (0)