diff --git a/pkg/ccl/logictestccl/testdata/logic_test/crdb_internal b/pkg/ccl/logictestccl/testdata/logic_test/crdb_internal index 2e58cad5190a..02074c148e72 100644 --- a/pkg/ccl/logictestccl/testdata/logic_test/crdb_internal +++ b/pkg/ccl/logictestccl/testdata/logic_test/crdb_internal @@ -188,21 +188,22 @@ statement ok SELECT crdb_internal.create_tenant(5) # Use retry because source data is eventually consistent. -query ITT colnames,retry -SELECT * FROM crdb_internal.node_tenant_capabilities_cache WHERE capability_name = 'can_admin_split' +query ITT colnames,retry,rowsort +SELECT * FROM crdb_internal.node_tenant_capabilities_cache WHERE capability_name = 'can_view_node_info' ---- -tenant_id capability_name capability_value -1 can_admin_split true +tenant_id capability_name capability_value +1 can_view_node_info true +5 can_view_node_info false statement ok -ALTER TENANT [5] GRANT CAPABILITY can_admin_split +ALTER TENANT [5] GRANT CAPABILITY can_view_node_info # Use retry because source data is eventually consistent. query ITT colnames,retry,rowsort -SELECT * FROM crdb_internal.node_tenant_capabilities_cache WHERE capability_name = 'can_admin_split' +SELECT * FROM crdb_internal.node_tenant_capabilities_cache WHERE capability_name = 'can_view_node_info' ---- tenant_id capability_name capability_value -1 can_admin_split true -5 can_admin_split true +1 can_view_node_info true +5 can_view_node_info true subtest end diff --git a/pkg/kv/kvclient/kvstreamer/streamer.go b/pkg/kv/kvclient/kvstreamer/streamer.go index a79a1e9efb85..333a496e170f 100644 --- a/pkg/kv/kvclient/kvstreamer/streamer.go +++ b/pkg/kv/kvclient/kvstreamer/streamer.go @@ -932,24 +932,26 @@ func (w *workerCoordinator) mainLoop(ctx context.Context) { // tracing span of the Streamer's user. Some time has been spent to figure it // out but led to no success. This should be cleaned up. func (w *workerCoordinator) logStatistics(ctx context.Context) { - avgResponseSize, _ := w.getAvgResponseSize() - log.VEventf( - ctx, 1, - "enqueueCalls=%d enqueuedRequests=%d enqueuedSingleRangeRequests=%d kvPairsRead=%d "+ - "batchRequestsIssued=%d resumeBatchRequests=%d resumeSingleRangeRequests=%d "+ - "numSpilledResults=%d emptyBatchResponses=%d droppedBatchResponses=%d avgResponseSize=%s", - w.s.enqueueCalls, - w.s.enqueuedRequests, - w.s.enqueuedSingleRangeRequests, - atomic.LoadInt64(w.s.atomics.kvPairsRead), - atomic.LoadInt64(w.s.atomics.batchRequestsIssued), - atomic.LoadInt64(&w.s.atomics.resumeBatchRequests), - atomic.LoadInt64(&w.s.atomics.resumeSingleRangeRequests), - w.s.results.numSpilledResults(), - atomic.LoadInt64(&w.s.atomics.emptyBatchResponses), - atomic.LoadInt64(&w.s.atomics.droppedBatchResponses), - humanizeutil.IBytes(avgResponseSize), - ) + if log.ExpensiveLogEnabled(ctx, 1) { + avgResponseSize, _ := w.getAvgResponseSize() + log.Eventf( + ctx, + "enqueueCalls=%d enqueuedRequests=%d enqueuedSingleRangeRequests=%d kvPairsRead=%d "+ + "batchRequestsIssued=%d resumeBatchRequests=%d resumeSingleRangeRequests=%d "+ + "numSpilledResults=%d emptyBatchResponses=%d droppedBatchResponses=%d avgResponseSize=%s", + w.s.enqueueCalls, + w.s.enqueuedRequests, + w.s.enqueuedSingleRangeRequests, + atomic.LoadInt64(w.s.atomics.kvPairsRead), + atomic.LoadInt64(w.s.atomics.batchRequestsIssued), + atomic.LoadInt64(&w.s.atomics.resumeBatchRequests), + atomic.LoadInt64(&w.s.atomics.resumeSingleRangeRequests), + w.s.results.numSpilledResults(), + atomic.LoadInt64(&w.s.atomics.emptyBatchResponses), + atomic.LoadInt64(&w.s.atomics.droppedBatchResponses), + humanizeutil.IBytes(avgResponseSize), + ) + } } // waitForRequests blocks until there is at least one request to be served.