Skip to content

Commit

Permalink
Merge pull request #115419 from cockroachdb/blathers/backport-release…
Browse files Browse the repository at this point in the history
…-23.2-115408

release-23.2: server: remove /debug/tickle
  • Loading branch information
stevendanna authored Dec 4, 2023
2 parents 0fd48d9 + c3ef09a commit 09f8ec0
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 45 deletions.
34 changes: 0 additions & 34 deletions pkg/server/debug/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ type Server struct {
spy logSpy
}

type serverTickleFn = func(ctx context.Context, name roachpb.TenantName) error

func setupProcessWideRoutes(
mux *http.ServeMux,
st *cluster.Settings,
Expand Down Expand Up @@ -150,7 +148,6 @@ func NewServer(
st *cluster.Settings,
hbaConfDebugFn http.HandlerFunc,
profiler pprofui.Profiler,
serverTickleFn serverTickleFn,
tenantID roachpb.TenantID,
authorizer tenantcapabilities.Authorizer,
) *Server {
Expand All @@ -169,15 +166,6 @@ func NewServer(
mux.HandleFunc("/debug/hba_conf", hbaConfDebugFn)
}

if serverTickleFn != nil {
// Register the server tickling function.
//
// TODO(knz): This can be removed once
// https://github.com/cockroachdb/cockroach/issues/84585 is
// implemented.
mux.Handle("/debug/tickle", handleTickle(serverTickleFn))
}

// Set up the log spy, a tool that allows inspecting filtered logs at high
// verbosity. We require the tenant ID from the ambientCtx to set the logSpy
// tenant filter.
Expand Down Expand Up @@ -330,25 +318,3 @@ If you are not redirected automatically, follow this <a href='/#/debug'>link</a>
</html>
`)
}

type handleTickle serverTickleFn

func (h handleTickle) ServeHTTP(w http.ResponseWriter, r *http.Request) {
opts := r.URL.Query()
var name string
if n := opts["name"]; len(n) > 0 {
name = n[0]
}
w.Header().Add("Content-type", "text/plain")
if name == "" {
fmt.Fprint(w, "no name specified")
return
}
ctx := r.Context()
err := serverTickleFn(h)(ctx, roachpb.TenantName(name))
if err != nil {
fmt.Fprint(w, err)
return
}
fmt.Fprintf(w, "server for tenant %q was tickled", name)
}
10 changes: 0 additions & 10 deletions pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -1242,16 +1242,6 @@ func NewServer(cfg Config, stopper *stop.Stopper) (serverctl.ServerStartupInterf
st,
sqlServer.pgServer.HBADebugFn(),
sqlServer.execCfg.SQLStatusServer,
// TODO(knz): Remove this once
// https://github.com/cockroachdb/cockroach/issues/84585 is
// implemented.
func(ctx context.Context, name roachpb.TenantName) error {
d, _, err := sc.getServer(ctx, name)
if err != nil {
return err
}
return errors.Newf("server found with type %T", d)
},
roachpb.SystemTenantID,
authorizer,
)
Expand Down
1 change: 0 additions & 1 deletion pkg/server/tenant.go
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,6 @@ func newTenantServer(
args.Settings,
sqlServer.pgServer.HBADebugFn(),
sqlServer.execCfg.SQLStatusServer,
nil, /* serverTickleFn */
sqlCfg.TenantID,
processCapAuthz,
)
Expand Down

0 comments on commit 09f8ec0

Please sign in to comment.