@yugabytedb/perf-advisor-ui 1.0.161 → 1.0.163
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.d.ts +24 -2
- package/dist/components/HighAvailability/HaMembersTable.d.ts +38 -0
- package/dist/components/HighAvailability/HaSetupDialog.d.ts +27 -0
- package/dist/components/HighAvailability/HighAvailability.d.ts +11 -0
- package/dist/components/HighAvailability/StandbyBanner.d.ts +28 -0
- package/dist/components/RuntimeConfigs/ResetRuntimeConfig.d.ts +3 -1
- package/dist/components/RuntimeConfigs/RuntimeConfigs.d.ts +2 -1
- package/dist/components/RuntimeConfigs/ScopeEntitySelect.d.ts +12 -0
- package/dist/components/RuntimeConfigs/ScopeSelector.d.ts +8 -0
- package/dist/components/RuntimeConfigs/UpdateRuntimeConfig.d.ts +3 -1
- package/dist/components/RuntimeConfigs/helpers.d.ts +10 -0
- package/dist/components/RuntimeConfigs/runtimeConfigColumns.d.ts +11 -0
- package/dist/components/RuntimeConfigs/types.d.ts +11 -0
- package/dist/components/SecondaryDashboard/DrilldownView/BindVariablesSection.d.ts +10 -0
- package/dist/components/SecondaryDashboard/DrilldownView/BindVariablesToggleDialog.d.ts +10 -0
- package/dist/components/SecondaryDashboard/DrilldownView/QpmInstructionText.d.ts +5 -0
- package/dist/components/SecondaryDashboard/DrilldownView/QueryPlanManagement.d.ts +3 -1
- package/dist/components/SecondaryDashboard/DrilldownView/useBindVariablesCollection.d.ts +8 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/esm/index.js +15536 -14011
- package/dist/esm/index.js.map +1 -1
- package/dist/helpers/bindVariablesText.d.ts +26 -0
- package/dist/helpers/constants.d.ts +3 -0
- package/dist/helpers/dtos.d.ts +160 -0
- package/dist/helpers/gflagUtils.d.ts +4 -0
- package/dist/helpers/useHaStandby.d.ts +52 -0
- package/package.json +1 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AppName } from './dtos';
|
|
2
|
+
export declare const getEntityLabel: (appName: AppName) => string;
|
|
3
|
+
export interface BindVariablesGflagReason {
|
|
4
|
+
title: string;
|
|
5
|
+
instruction: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const getBindVariablesText: (appName: AppName) => {
|
|
8
|
+
sectionTitle: string;
|
|
9
|
+
toggleLabel: string;
|
|
10
|
+
collectionOff: string;
|
|
11
|
+
noValueYet: string;
|
|
12
|
+
valueCaveat: string;
|
|
13
|
+
enableDialog: {
|
|
14
|
+
title: string;
|
|
15
|
+
submitLabel: string;
|
|
16
|
+
body: string;
|
|
17
|
+
note: string;
|
|
18
|
+
};
|
|
19
|
+
disableDialog: {
|
|
20
|
+
title: string;
|
|
21
|
+
submitLabel: string;
|
|
22
|
+
body: string;
|
|
23
|
+
warning: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export declare const getBindVariablesGflagReason: (gflagEnabled: boolean, appName: AppName) => BindVariablesGflagReason | null;
|
|
@@ -109,7 +109,10 @@ export declare const RUNTIME_CONFIG_KEYS: {
|
|
|
109
109
|
SHOW_TOPK_METRICS_VIEW: string;
|
|
110
110
|
SHOW_DB_CLUSTER_LOAD_VIEW: string;
|
|
111
111
|
SHOW_TIMEZONE_SELECTOR: string;
|
|
112
|
+
QUERY_PLANS_STORE_BIND_VARIABLES: string;
|
|
112
113
|
};
|
|
114
|
+
export declare const YB_PG_STAT_PLANS_SHOW_MAX_EXEC_PARAMS = "yb_pg_stat_plans_show_max_exec_params";
|
|
115
|
+
export declare const YSQL_PG_CONF_CSV_GFLAG = "ysql_pg_conf_csv";
|
|
113
116
|
export declare const ANOMALY_TYPE_TO_NAME_MAP: Record<string, string>;
|
|
114
117
|
export declare const MORE = "MORE";
|
|
115
118
|
export declare const ELLIPSIS = "...";
|
package/dist/helpers/dtos.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export interface Universe {
|
|
|
8
8
|
isPgssRpcStatsSupported?: boolean;
|
|
9
9
|
qpmEnabled?: boolean;
|
|
10
10
|
qpmSupported?: boolean;
|
|
11
|
+
qpmBindVariablesEnabled?: boolean;
|
|
11
12
|
kubernetes?: boolean;
|
|
12
13
|
resources: Resources;
|
|
13
14
|
universeConfig: UniverseConfig;
|
|
@@ -611,6 +612,16 @@ export declare enum RuntimeConfigType {
|
|
|
611
612
|
BOOL = "BOOL",
|
|
612
613
|
DURATION = "DURATION"
|
|
613
614
|
}
|
|
615
|
+
export declare enum RuntimeConfigScopeLevel {
|
|
616
|
+
GLOBAL = "GLOBAL",
|
|
617
|
+
CUSTOMER = "CUSTOMER",
|
|
618
|
+
UNIVERSE = "UNIVERSE"
|
|
619
|
+
}
|
|
620
|
+
export interface UniverseDetailsListItem {
|
|
621
|
+
universeUUID: string;
|
|
622
|
+
name: string;
|
|
623
|
+
ybmClusterName?: string;
|
|
624
|
+
}
|
|
614
625
|
export interface IndexAnomalyDetails {
|
|
615
626
|
indexName: string;
|
|
616
627
|
schemaName: string;
|
|
@@ -979,4 +990,153 @@ export interface QueryPlanData {
|
|
|
979
990
|
totalTime: number;
|
|
980
991
|
universeId: string;
|
|
981
992
|
}
|
|
993
|
+
export declare enum HaMemberRole {
|
|
994
|
+
LEADER = "LEADER",
|
|
995
|
+
FOLLOWER = "FOLLOWER"
|
|
996
|
+
}
|
|
997
|
+
/**
|
|
998
|
+
* Lifecycle state of an HA member. Mirrors {@code HaMember.State} on the backend:
|
|
999
|
+
* <ul>
|
|
1000
|
+
* <li>{@code PENDING} - freshly added; bootstrap not started yet.</li>
|
|
1001
|
+
* <li>{@code JOINING} - bootstrap streaming in progress; not eligible for promotion.</li>
|
|
1002
|
+
* <li>{@code READY} - bootstrap done and change feed caught up; eligible for promotion.</li>
|
|
1003
|
+
* <li>{@code FAILED} - bootstrap retry budget exhausted; requires operator to hit the
|
|
1004
|
+
* "Retry Bootstrap" action ({@code POST /api/ha/member/bootstrap/restart}) after
|
|
1005
|
+
* resolving the underlying cause. Not eligible for promotion.</li>
|
|
1006
|
+
* </ul>
|
|
1007
|
+
* The Promote button in the members table is disabled for anything other than {@code READY}.
|
|
1008
|
+
*/
|
|
1009
|
+
export declare enum HaMemberLifecycleState {
|
|
1010
|
+
PENDING = "PENDING",
|
|
1011
|
+
JOINING = "JOINING",
|
|
1012
|
+
READY = "READY",
|
|
1013
|
+
FAILED = "FAILED",
|
|
1014
|
+
/**
|
|
1015
|
+
* Bootstrap completed cleanly at some point, but one or more CONFIG-class change entries
|
|
1016
|
+
* or bootstrap rows failed to apply locally because of schema drift the follower can't
|
|
1017
|
+
* heal on its own (typically a NOT NULL column on the follower that the newer leader
|
|
1018
|
+
* stopped emitting, or the reverse across an N-1 to N+1 upgrade). The promotion gate
|
|
1019
|
+
* refuses this state unless the operator confirms via the "Force Promote" dialog and
|
|
1020
|
+
* accepts the possibly-lossy handover. Auto-clears back to READY on the next successful
|
|
1021
|
+
* full-or-CONFIG bootstrap.
|
|
1022
|
+
*/
|
|
1023
|
+
STALE_CONFIG = "STALE_CONFIG"
|
|
1024
|
+
}
|
|
1025
|
+
export interface HaMemberSpec {
|
|
1026
|
+
uuid: string;
|
|
1027
|
+
paEndpoint: string;
|
|
1028
|
+
isLocal?: boolean;
|
|
1029
|
+
}
|
|
1030
|
+
export interface HaMemberState {
|
|
1031
|
+
uuid: string;
|
|
1032
|
+
paEndpoint: string;
|
|
1033
|
+
role: HaMemberRole;
|
|
1034
|
+
/**
|
|
1035
|
+
* Lifecycle state carried on every {@code GET /api/ha/state} response. Undefined only when
|
|
1036
|
+
* talking to a pre-lifecycle backend - treat as {@code READY} in that case to preserve the
|
|
1037
|
+
* old behavior where every present member was implicitly promotable.
|
|
1038
|
+
*/
|
|
1039
|
+
state?: HaMemberLifecycleState | null;
|
|
1040
|
+
lastAppliedSeq: number;
|
|
1041
|
+
lastSeen?: string | null;
|
|
1042
|
+
isLocal: boolean;
|
|
1043
|
+
/**
|
|
1044
|
+
* Number of consecutive failed bootstrap attempts. Zero on a healthy member; non-zero while
|
|
1045
|
+
* the follower is retrying and mid-JOINING. Renders as "N failed attempts" alongside the
|
|
1046
|
+
* state badge in the HA members table. Undefined against pre-retry-tracking backends.
|
|
1047
|
+
*/
|
|
1048
|
+
bootstrapAttempts?: number | null;
|
|
1049
|
+
/**
|
|
1050
|
+
* Timestamp of the last bootstrap attempt (success or failure). Combined with the server's
|
|
1051
|
+
* retry interval this lets the UI show "next retry in ~Xm" while a bootstrap is in flight
|
|
1052
|
+
* with a non-zero attempt count.
|
|
1053
|
+
*/
|
|
1054
|
+
bootstrapLastAttemptAt?: string | null;
|
|
1055
|
+
/**
|
|
1056
|
+
* Short human-readable reason attached to the most recent bootstrap failure. Present only
|
|
1057
|
+
* while state is JOINING with pending retries or {@code FAILED}. Rendered as a tooltip on
|
|
1058
|
+
* the state badge so operators can triage from the UI without opening server logs.
|
|
1059
|
+
*/
|
|
1060
|
+
bootstrapLastError?: string | null;
|
|
1061
|
+
/**
|
|
1062
|
+
* PA release string the peer is currently running, as observed via the {@code X-PA-HA-Version}
|
|
1063
|
+
* wire header (leader-side) or {@code HaChangesResponse.leaderVersion} (follower-side). Null
|
|
1064
|
+
* against pre-V84 backends or on freshly-added members before the first heartbeat has landed.
|
|
1065
|
+
* Rendered in the "PA Version" column of the members table so operators can spot version
|
|
1066
|
+
* drift during a rolling upgrade at a glance; the backend uses it to refuse promotion of a
|
|
1067
|
+
* peer whose version is strictly older than the current leader's (unless force=true).
|
|
1068
|
+
*/
|
|
1069
|
+
paVersion?: string | null;
|
|
1070
|
+
/**
|
|
1071
|
+
* Wall-clock timestamp of the READY -> STALE_CONFIG transition on this member. Rendered
|
|
1072
|
+
* in the state cell tooltip so operators can tell "we just noticed this drift" from
|
|
1073
|
+
* "we've been stuck for 15 minutes". Cleared to null when the state auto-clears back to
|
|
1074
|
+
* READY after a successful full-or-CONFIG bootstrap. Null on any member that has not
|
|
1075
|
+
* entered STALE_CONFIG in the current lifecycle.
|
|
1076
|
+
*/
|
|
1077
|
+
staleConfigSince?: string | null;
|
|
1078
|
+
}
|
|
1079
|
+
export interface HaState {
|
|
1080
|
+
groupConfigured: boolean;
|
|
1081
|
+
groupUuid?: string | null;
|
|
1082
|
+
currentTerm: number;
|
|
1083
|
+
leaderMemberUuid?: string | null;
|
|
1084
|
+
localMemberUuid?: string | null;
|
|
1085
|
+
members: HaMemberState[];
|
|
1086
|
+
/**
|
|
1087
|
+
* Computed "is this PA currently scraping" bit. Sourced from
|
|
1088
|
+
* {@code HaService.isScrapingEnabled()} on the backend: {@code true} when this PA is not part
|
|
1089
|
+
* of an HA group at all, when it's the LEADER inside one, or when the deployment runs with
|
|
1090
|
+
* {@code yb.cloud.enabled=true}. Exposed for read-only display in the HA page's status card;
|
|
1091
|
+
* the UI does not toggle it directly (the retired {@code POST /api/ha/scraper} endpoint used
|
|
1092
|
+
* to serve that role, but that persistent override was removed once follower-side leave
|
|
1093
|
+
* started wiping leader-owned config).
|
|
1094
|
+
*/
|
|
1095
|
+
scraperEnabled: boolean;
|
|
1096
|
+
/**
|
|
1097
|
+
* Cluster key from the local {@code ha_group} row. Present on the admin-token
|
|
1098
|
+
* {@code GET /api/ha/state} surface only - the UI uses it to power the "Copy cluster key"
|
|
1099
|
+
* affordance so operators can add another standby at any time without regenerating the key
|
|
1100
|
+
* and invalidating existing peers. Absent (undefined) when no group is configured.
|
|
1101
|
+
*/
|
|
1102
|
+
clusterKey?: string | null;
|
|
1103
|
+
}
|
|
1104
|
+
export declare enum HaGroupMode {
|
|
1105
|
+
ACTIVE = "ACTIVE",
|
|
1106
|
+
STANDBY = "STANDBY"
|
|
1107
|
+
}
|
|
1108
|
+
export interface HaGroupRequest {
|
|
1109
|
+
groupUuid: string;
|
|
1110
|
+
clusterKey: string;
|
|
1111
|
+
members: HaMemberSpec[];
|
|
1112
|
+
initialLeaderUuid?: string | null;
|
|
1113
|
+
term: number;
|
|
1114
|
+
/**
|
|
1115
|
+
* Bootstrap flavor. Defaults to {@link HaGroupMode.ACTIVE} on the backend for backward
|
|
1116
|
+
* compatibility. Use {@link HaGroupMode.STANDBY} to register as a follower - the local PA
|
|
1117
|
+
* fetches the authoritative topology from {@link HaGroupRequest.remoteLeaderEndpoint} before
|
|
1118
|
+
* persisting anything, so it lands on the same {@code groupUuid} / {@code currentTerm} /
|
|
1119
|
+
* leader as the active PA.
|
|
1120
|
+
*/
|
|
1121
|
+
mode?: HaGroupMode;
|
|
1122
|
+
/**
|
|
1123
|
+
* Required for {@link HaGroupMode.STANDBY}: base URL of the active PA (e.g.
|
|
1124
|
+
* {@code https://active-pa.example.com:8080}). The backend calls {@code
|
|
1125
|
+
* <remoteLeaderEndpoint>/api/ha/topology} with the shared cluster key at bootstrap; if the
|
|
1126
|
+
* fetch fails the whole {@code POST /api/ha/group} call fails and the standby stays
|
|
1127
|
+
* unconfigured, matching the "no half-configured state" invariant the leader-push flow
|
|
1128
|
+
* relies on. Ignored in {@link HaGroupMode.ACTIVE}.
|
|
1129
|
+
*/
|
|
1130
|
+
remoteLeaderEndpoint?: string;
|
|
1131
|
+
}
|
|
1132
|
+
export interface HaPromoteRequest {
|
|
1133
|
+
memberUuid: string;
|
|
1134
|
+
term: number;
|
|
1135
|
+
/**
|
|
1136
|
+
* When true, bypass the promote gates (version-order and STALE_CONFIG). Defaults to false
|
|
1137
|
+
* on the backend if omitted. The UI only sends true after the operator confirms in the
|
|
1138
|
+
* "Force Promote" dialog and accepts the possibly-lossy handover semantics.
|
|
1139
|
+
*/
|
|
1140
|
+
force?: boolean;
|
|
1141
|
+
}
|
|
982
1142
|
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Universe } from './dtos';
|
|
2
|
+
export declare const getTserverGFlagValue: (universe: Universe | undefined, flagName: string) => string | undefined;
|
|
3
|
+
export declare const parseYsqlPgConfCsvBool: (csv: string | undefined, paramName: string) => boolean | undefined;
|
|
4
|
+
export declare const isBindVariablesGflagEnabled: (universe: Universe | undefined) => boolean;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Result of `useHaStandby`. Kept as a plain object (not a class) so callers can destructure at
|
|
3
|
+
* the point of use without repeated hook fields; the JSDoc on each field is the source of
|
|
4
|
+
* truth for what "standby" means.
|
|
5
|
+
*/
|
|
6
|
+
export interface HaStandbyStatus {
|
|
7
|
+
/**
|
|
8
|
+
* `true` iff this PA is currently a FOLLOWER in an HA group. `false` for LEADER and for the
|
|
9
|
+
* (much more common) case of a PA that is not in any HA group at all. Callers should treat
|
|
10
|
+
* `false` as "you are on the correct PA to make mutations" - the primary consumer is the
|
|
11
|
+
* per-page mutation-button disable logic which grays out actions and points operators at
|
|
12
|
+
* the leader when this is `true`.
|
|
13
|
+
*
|
|
14
|
+
* <p>Deliberately conservative: while the initial `/api/ha/state` fetch is in flight (or has
|
|
15
|
+
* errored), we return `false`. Reasoning: (a) blocking every action on a network round-trip
|
|
16
|
+
* would regress every dev/single-node deploy; (b) the server-side {@code
|
|
17
|
+
* HaService.requireLeaderOrStandalone} refuses on the wire anyway, so a UI that "leaks" a
|
|
18
|
+
* click through will still get a 409 with a helpful message, not a silent write. The banner
|
|
19
|
+
* appearing after the fetch resolves is a strictly-better failure mode than the whole app
|
|
20
|
+
* locking up on load.
|
|
21
|
+
*/
|
|
22
|
+
isStandby: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* When {@link #isStandby} is `true`, the {@code pa_endpoint} of the current leader as
|
|
25
|
+
* reported by `/api/ha/state`. Null when we can't identify a leader (e.g. group has no
|
|
26
|
+
* leader elected, or the leader row is missing an endpoint). The standby banner uses this
|
|
27
|
+
* to render a "go to <endpoint>" link so operators can jump to the correct PA in one
|
|
28
|
+
* click; button tooltips also embed this string when non-null.
|
|
29
|
+
*/
|
|
30
|
+
leaderEndpoint: string | null;
|
|
31
|
+
/** `true` while the underlying HA state fetch has not yet resolved once. */
|
|
32
|
+
isLoading: boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* React hook that resolves to the current PA's HA-standby status.
|
|
36
|
+
*
|
|
37
|
+
* <p>Design notes:
|
|
38
|
+
*
|
|
39
|
+
* <ul>
|
|
40
|
+
* <li>Shares the {@code QUERY_KEY.fetchHaState} key with the HA UI page, so on a session
|
|
41
|
+
* where the operator opens both a regular page and the HA UI page we only hit
|
|
42
|
+
* `/api/ha/state` once every 30s (react-query dedupes by key).
|
|
43
|
+
* <li>The 30s refetch interval matches the follower poll cadence: any role change on the
|
|
44
|
+
* server appears in the UI within one poll cycle even without any operator action.
|
|
45
|
+
* <li>Errors during fetch are absorbed: we return {@code isStandby: false} so a temporary
|
|
46
|
+
* network hiccup doesn't lock down mutation controls on a healthy leader.
|
|
47
|
+
* </ul>
|
|
48
|
+
*
|
|
49
|
+
* @param apiUrl Optional API URL prefix (e.g. when this PA is served behind YBA at a
|
|
50
|
+
* non-root path). If omitted, relative `/api/ha/state` is used.
|
|
51
|
+
*/
|
|
52
|
+
export declare const useHaStandby: (apiUrl?: string) => HaStandbyStatus;
|