Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
86139: ui/cluster-ui: prevent returning new obj from session storage every time r=xinhaoz a=xinhaoz

When we retrieve from localSettings in db-console, we retrieve
in the following order: `localSettings ?? sessionStorage ?? defaultValue`
The value from the session storage is retrieved via parsing a JSON
string and returning a new object. In the active execution pages, we
update the URL search string every time the filters object changes to
reflect any filters selected. Due to the local settings behaviour,
we could end up in an infinite update loop if we continously read from
session storage since a new object was being returned each time
(e.g. on a hard refresh). To prevent this, when retrieving a stored
value, if it exists in session storage but not local storage, we can
set the local setting to be parsed object from session storage.

Release note (bug fix): active execution pages will no longer crash
if there are no filters set in local settings.

Release justification: bug fix

86147: kvserver: default admission.kv.pause_replication_io_threshold to 0.8 r=erikgrinaker a=tbg

Closes cockroachdb#83920.

Release note (ops change): The
`admission.kv.pause_replication_threshold` cluster setting is now set to
a default value of 0.8. On a fully migrated v22.2+ deployment, this will
allow the KV layer to pause replication streams to followers located on
stores that are close to activating their I/O admission control
subsystem (thereby protecting these followers from additional overload).
The cluster setting can be disabled by setting to zero.

Release justification: enables new functionality


86152: docs: remove 'api change' from git commit scripts r=knz a=taroface

The recently published API Support Policy and updated [release note guidelines](https://cockroachlabs.atlassian.net/wiki/spaces/CRDB/pages/186548364/Release+notes) resulted in removing `api change` from the list of valid release note categories. This removes the syntax from the release note generation.

Release justification: changes to doc only
Release note: None

Co-authored-by: Xin Hao Zhang <[email protected]>
Co-authored-by: Tobias Grieger <[email protected]>
Co-authored-by: Ryan Kuo <[email protected]>
  • Loading branch information
4 people committed Aug 15, 2022
4 parents 33b343d + fff9cce + 1fa00d4 + 454826e commit 3870f3a
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 13 deletions.
3 changes: 0 additions & 3 deletions githooks/commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ else
"cli change") ;;
"ops change") ;;
"sql change") ;;
"api change") ;;
"ui change") ;;
"general change") ;;
"build change") ;;
Expand All @@ -157,8 +156,6 @@ else
hint "Try 'Release note ($lcat)' -> 'Release note (security update)'" ;;
sql*)
hint "Try 'Release note ($lcat)' -> 'Release note (sql change)'" ;;
api*)
hint "Try 'Release note ($lcat)' -> 'Release note (api change)'" ;;
"admin ui"*|"admin-ui"*)
hint "Try 'Release note ($lcat)' -> 'Release note (ui change)'" ;;
"backwards-incompatible"*|"backward incompatible"*)
Expand Down
1 change: 0 additions & 1 deletion githooks/prepare-commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ $cchar Categories for release notes:\\
$cchar - cli change\\
$cchar - ops change\\
$cchar - sql change\\
$cchar - api change\\
$cchar - ui change\\
$cchar - security update\\
$cchar - general change (e.g., change of required Go version)\\
Expand Down
4 changes: 1 addition & 3 deletions pkg/kv/kvserver/replica_raft_overload.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ var pauseReplicationIOThreshold = settings.RegisterFloatSetting(
settings.SystemOnly,
"admission.kv.pause_replication_io_threshold",
"pause replication to non-essential followers when their I/O admission control score exceeds the given threshold (zero to disable)",
// TODO(tbg): set a sub-one default.
// See: https://github.com/cockroachdb/cockroach/issues/83920
10000,
0.8,
func(v float64) error {
if v == 0 {
return nil
Expand Down
4 changes: 4 additions & 0 deletions pkg/kv/kvserver/store_raft.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ package kvserver

import (
"context"
"math"
"time"
"unsafe"

Expand Down Expand Up @@ -770,6 +771,9 @@ func (s *Store) updateIOThresholdMap() {
ioThresholdMap[sd.StoreID] = &ioThreshold
}
threshold := pauseReplicationIOThreshold.Get(&s.cfg.Settings.SV)
if threshold <= 0 {
threshold = math.MaxFloat64
}
old, cur := s.ioThresholds.Replace(ioThresholdMap, threshold)
// Log whenever the set of overloaded stores changes.
shouldLog := log.V(1) || old.seq != cur.seq
Expand Down
3 changes: 3 additions & 0 deletions pkg/ui/workspaces/db-console/src/redux/localsettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ export class LocalSetting<S, T> {
innerSelector,
() => getValueFromSessionStorage(this.key),
(uiSettings, cachedValue) => {
if (cachedValue != null && uiSettings[this.key] == null) {
uiSettings[this.key] = cachedValue;
}
return uiSettings[this.key] ?? cachedValue ?? defaultValue;
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ const selectedColumnsLocalSetting = new LocalSetting<
null,
);

const defaultActiveFilters = { app: defaultFilters.app };

const filtersLocalSetting = new LocalSetting<
AdminUIState,
ActiveStatementFilters
>(
"filters/ActiveStatementsPage",
(state: AdminUIState) => state.localSettings,
{ app: defaultFilters.app },
defaultActiveFilters,
);

const sortSettingLocalSetting = new LocalSetting<AdminUIState, SortSetting>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ const transactionsColumnsLocalSetting = new LocalSetting<
null,
);

const defaultActiveTxnFilters = { app: defaultFilters.app };

const filtersLocalSetting = new LocalSetting<
AdminUIState,
ActiveTransactionFilters
>(
"filters/ActiveTransactionsPage",
(state: AdminUIState) => state.localSettings,
{ app: defaultFilters.app },
defaultActiveTxnFilters,
);

const sortSettingLocalSetting = new LocalSetting<AdminUIState, SortSetting>(
Expand Down
4 changes: 0 additions & 4 deletions scripts/release-notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ def lookup_person(name, email):
'cli change': "Command-line changes",
'ops change': "Operational changes",
'sql change': "SQL language changes",
'api change': "API endpoint changes",
'ui change': "DB Console changes",
'general change': "General changes",
'build change': "Build changes",
Expand All @@ -177,7 +176,6 @@ def lookup_person(name, email):
'sql change',
'ops change',
'cli change',
'api change',
'ui change',
'bug fix',
'performance improvement',
Expand All @@ -195,8 +193,6 @@ def lookup_person(name, email):
'ui': 'ui change',
'operational change': 'ops change',
'admin ui': 'ui change',
'api': 'api change',
'http': 'api change',
'backwards-incompatible change': 'backward-incompatible change',
'enterprise': 'enterprise change',
'security': 'security update',
Expand Down

0 comments on commit 3870f3a

Please sign in to comment.