forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
93054: roachtest: add `failover/system-non-liveness` r=erikgrinaker a=erikgrinaker This patch adds a roachtest measuring the pMax latency impact on user ranges when system range leaseholders fail (excluding the liveness range, which is tested individually in `failover/liveness`). Ideally, this should not affect user traffic at all, and the results confirm this. Epic: none Release note: None 93057: cli/sql: properly support special COPY input mode r=otan a=knz Fixes cockroachdb#93031. When in COPY mode, multi-line input is disabled and the tab key inputs raw ASCII TAB characters. This commit achieves this by redirecting the input to either the interactive editor or the bufio-based editor, depending on whether the current mode is COPY. NB: using ctrl+c while in COPY mode will not work with this patch, but that is caused by a separate issue cockroachdb#93053 and the behavior will be restored when that separate issue is fixed. In the meantime the user can use `\.` or ctrl+d to terminate their input. Release note: None 93081: ui: prevent additional RPC fanout in insights api r=xinhaoz a=xinhaoz Previously the query used to fetch insights was triggering 2 cluster-wide RPC fanouts by doing a self-join on `crdb_internal.cluster_execution_insights`. We should buffer the insights virtual table to prevent an additional fanout to construct the table again. Epic: none Release note: None Co-authored-by: Erik Grinaker <[email protected]> Co-authored-by: Raphael 'kena' Poss <[email protected]> Co-authored-by: Xin Hao Zhang <[email protected]>
- Loading branch information
Showing
6 changed files
with
313 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
// Copyright 2022 The Cockroach Authors. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file licenses/BSL.txt. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0, included in the file | ||
// licenses/APL.txt. | ||
|
||
package clisqlshell | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/cockroachdb/errors" | ||
) | ||
|
||
// bimodalEditor redirects the input to either a "main" editor | ||
// (outside of COPY mode) or a "copy" editor (inside COPY). | ||
// This is because the main editor may be multi-line and | ||
// thus inadequate for input of COPY data. | ||
type bimodalEditor struct { | ||
sql sqlShell | ||
main editor | ||
copy editor | ||
} | ||
|
||
var _ editor = (*bimodalEditor)(nil) | ||
|
||
func (e *bimodalEditor) init( | ||
win, wout, werr *os.File, sqlS sqlShell, maxHistEntries int, histFile string, | ||
) (cleanupFn func(), err error) { | ||
e.sql = sqlS | ||
c1, err := e.main.init(win, wout, werr, sqlS, maxHistEntries, histFile) | ||
if err != nil { | ||
return c1, err | ||
} | ||
c2, err := e.copy.init(win, wout, werr, sqlS, maxHistEntries, histFile) | ||
cleanupFn = func() { | ||
c1() | ||
c2() | ||
} | ||
return cleanupFn, err | ||
} | ||
|
||
func (e *bimodalEditor) selected() editor { | ||
if e.sql.inCopy() { | ||
return e.copy | ||
} | ||
return e.main | ||
} | ||
|
||
func (e *bimodalEditor) errInterrupted() error { | ||
return e.selected().errInterrupted() | ||
} | ||
|
||
func (e *bimodalEditor) getOutputStream() *os.File { | ||
return e.selected().getOutputStream() | ||
} | ||
|
||
func (e *bimodalEditor) getLine() (string, error) { | ||
return e.selected().getLine() | ||
} | ||
|
||
func (e *bimodalEditor) addHistory(line string) error { | ||
return errors.CombineErrors( | ||
e.copy.addHistory(line), | ||
e.main.addHistory(line)) | ||
} | ||
|
||
func (e *bimodalEditor) canPrompt() bool { | ||
return e.main.canPrompt() | ||
} | ||
|
||
func (e *bimodalEditor) setPrompt(prompt string) { | ||
e.copy.setPrompt(prompt) | ||
e.main.setPrompt(prompt) | ||
} | ||
|
||
func (e *bimodalEditor) multilineEdit() bool { | ||
return e.selected().multilineEdit() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.