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
102478: kvserver: only return range info when `ClientRangeInfo` set r=erikgrinaker a=erikgrinaker Previously, passing an empty `ClientRangeInfo` would always generate and return range info, because the zero values are always considered stale. An exception was made for lease requests, since these bypass DistSender and never use `ClientRangeInfo`. This patch instead only returns range info when a non-empty `ClientRangeInfo` is passed, with a version gate for 23.1 compatibility. Epic: none Release note: None 103127: kvserver: include more non-redactable info in logs r=aliher1911 a=knz This patch ensures that the trace copy in replication errors includes non-redactable bits. It also ensures that the purgatory errors are properly included. Release note: None Epic: None Co-authored-by: Erik Grinaker <grinaker@cockroachlabs.com> Co-authored-by: Raphael 'kena' Poss <knz@thaumogen.net>
- Loading branch information
Showing
9 changed files
with
121 additions
and
40 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
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,29 @@ | ||
// Copyright 2023 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 kvserver | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/cockroachdb/cockroach/pkg/util/leaktest" | ||
"github.com/cockroachdb/errors" | ||
"github.com/cockroachdb/redact" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestErrorFormatting(t *testing.T) { | ||
defer leaktest.AfterTest(t)() | ||
|
||
var e error = decommissionPurgatoryError{errors.New("hello")} | ||
require.Equal(t, "hello", redact.Sprint(e).Redact().StripMarkers()) | ||
e = rangeMergePurgatoryError{errors.New("hello")} | ||
require.Equal(t, "hello", redact.Sprint(e).Redact().StripMarkers()) | ||
} |
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
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