Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pageserver: cleaner error handling if client sends sharded request to wrong pageserver #6038

Closed
Tracked by #5507
jcsp opened this issue Dec 5, 2023 · 1 comment
Closed
Tracked by #5507
Assignees
Labels
a/tech_debt Area: related to tech debt c/storage/pageserver Component: storage: pageserver

Comments

@jcsp
Copy link
Contributor

jcsp commented Dec 5, 2023

In #5980:

            let timeline = match self
                .get_active_tenant_timeline(
                    timeline.tenant_shard_id.tenant_id,
                    timeline.timeline_id,
                    ShardSelector::Page(key),
                )
                .await
            {
                Ok(t) => t,
                Err(GetActiveTimelineError::Tenant(GetActiveTenantError::NotFound(_))) => {
                    // We already know this tenant exists in general, because we resolved it at
                    // start of connection.  Getting a NotFound here indicates that the shard containing
                    // the requested page is not present on this node.

                    // TODO: this should be some kind of structured error that the client will understand,
                    // so that it can block until its config is updated: this error is expected in the case
                    // that the Tenant's shards' placements are being updated and the client hasn't been
                    // informed yet.
                    return Err(anyhow::anyhow!("Request routed to wrong shard"));
                }
                Err(e) => return Err(e.into()),
   1         };
@jcsp jcsp added c/storage/pageserver Component: storage: pageserver a/tech_debt Area: related to tech debt labels Dec 5, 2023
@jcsp jcsp self-assigned this Jan 3, 2024
@jcsp
Copy link
Contributor Author

jcsp commented Jan 4, 2024

@jcsp jcsp closed this as completed Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a/tech_debt Area: related to tech debt c/storage/pageserver Component: storage: pageserver
Projects
None yet
Development

No branches or pull requests

1 participant