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.
server: feature-gate the span config manager
We'll repurpose the COCKROACH_EXPERIMENTAL_SPAN_CONFIGS envvar introduced in the previous commit to prevent initializing the span config manager for the host tenant (now truly switching off all span config infrastructure unless explicitly opted into). For both host and secondary tenants, we also want to disable the creation of the span config reconciliation job by default. We introduce `spanconfig.experimental_reconciliation_job.enabled` to that end. --- We re-work some of the controls around when we start the reconciliation job. It was previously possible for a tenant pod to start with a conservative view of it's cluster version setting, decide not to create the reconciliation job, find out about the up-to-date cluster version (introducing the span config job), but only create it when the next `check_interval` timer fired. This was undesirable. We also want to "bounce" the job immediately when the `check_interval` setting is changed. The earlier code didn't quite provide that property. Release justification: non-production code changes Release note: None
- Loading branch information
1 parent
ce9e3b7
commit f3c94ef
Showing
18 changed files
with
285 additions
and
131 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
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
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,39 @@ | ||
// Copyright 2021 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 spanconfigkvaccessor | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/cockroachdb/cockroach/pkg/roachpb" | ||
"github.com/cockroachdb/cockroach/pkg/spanconfig" | ||
"github.com/cockroachdb/errors" | ||
) | ||
|
||
// DisabledAccessor provides a implementation of the KVAccessor interface that | ||
// simply errors out with a disabled error. | ||
type DisabledAccessor struct{} | ||
|
||
// GetSpanConfigEntriesFor is part of the KVAccessor interface. | ||
func (n DisabledAccessor) GetSpanConfigEntriesFor( | ||
context.Context, []roachpb.Span, | ||
) ([]roachpb.SpanConfigEntry, error) { | ||
return nil, errors.New("span configs disabled") | ||
} | ||
|
||
// UpdateSpanConfigEntries is part of the KVAccessor interface. | ||
func (n DisabledAccessor) UpdateSpanConfigEntries( | ||
context.Context, []roachpb.Span, []roachpb.SpanConfigEntry, | ||
) error { | ||
return errors.New("span configs disabled") | ||
} | ||
|
||
var _ spanconfig.KVAccessor = &DisabledAccessor{} |
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
Oops, something went wrong.