Remove information-free ".context" messages

We capture stack traces of all errors, so these don't really add any
value. As a thought experiment, if we had to add a line like this,
with the function name in it, every time we use the ?-operator, we're
doing something wrong.

test_tenants.py::test_tenant_creation_fails creates a failpoint and
checks that the error returned by the pageserver contains the
failpoint name, and that was failing because it wasn't on the first
line of the error. We should probably improve our error-scraping logic
in the tests to not rely so heavily on string matching, but that's a
different topic.

FWIW, these are also pretty unlikely to fail in practice.
This commit is contained in:
Heikki Linnakangas
2022-11-24 18:30:45 +02:00
committed by Christian Schwarz
parent 6b61ed5fab
commit 5257bbe2b9

View File

@@ -213,10 +213,9 @@ pub fn create_tenant(
hash_map::Entry::Vacant(v) => {
// Hold the write_tenants() lock, since all of this is local IO.
// If this section ever becomes contentious, introduce a new `TenantState::Creating`.
let tenant_directory = super::tenant::create_tenant_files(conf, tenant_conf, tenant_id)
.context("create tenant files")?;
let created_tenant = load_local_tenant(conf, &tenant_directory, remote_storage)
.context("load created tenant")?;
let tenant_directory =
super::tenant::create_tenant_files(conf, tenant_conf, tenant_id)?;
let created_tenant = load_local_tenant(conf, &tenant_directory, remote_storage)?;
match created_tenant {
None => {
// We get None in case the directory is empty.