Namespace api find un-replicated namespace from primary DB
What does this MR do and why?
For issue https://gitlab.com/gitlab-org/customers-gitlab-com/-/issues/9808+
Gitlab.com trial has a create group flow. In this flow, the Customer create a new group, and passing the group.id to CustomersDot API to create the trial. CustomersDot API will find the namespace data by calling GitLab namespace API, using the group ID. Sometimes the Gitlab database has a delay to replicate from primary DB to replicate DB. In this case, when CustomersDot find the namespace data using Gitlab namespace API, there is a chance the newly created group is not found in replication DB in Gitlab. This causes 404 not found error.
This MR stick the namespace ID when the new group is created in the create group trial flow. Then in Gitlab namespace API, it query the namespace from up-to-date replica DB(or primary DB). This ensures the newly created group be found correctly.
References
Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
| Before | After |
|---|---|
|
Trial with |
Trial with |
How to set up and validate locally
- Enable database load balancing feature in GDK, following this documentation. Especially make sure to Simulating replication delay
- Start Gitlab application and CustomersDot application
- In Gitlab application, create a new group, go to group billing page
- On group billing page, click the button
Start free trial of GitLab Ultimate and GitLab Duo Enterprise, fill in required data, and clickContinuebutton
- Select
create group, and clickActivate my trial. It should succeed.
- Switch to
masterbranch, repeat the same test in step 3/4/5, the trial creation failed due to namespace not found.









