Skip to content

PBM-1547 Spike PoC for control collection rs #1167

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

Open
wants to merge 9 commits into
base: dev
Choose a base branch
from

Conversation

veceraj
Copy link
Contributor

@veceraj veceraj commented Jul 22, 2025

PBM-1547 Powered by Pull Request Badge

This PR serves as a prototype for porting the control collection to a separate mongo instance. A new ccrsUri parameter for pbm-agent and pbm has been added and as result Control collection data is stored only in CCRS. This parameter is optional and if omitted pbm reuses lead conn.

In some functions additional parameter for ccrsConn has been added when both conns were needed.

The remaining part of Spike will be presented in slides: [url to slides] - wip

@veceraj veceraj marked this pull request as ready for review July 29, 2025 01:47
@veceraj veceraj requested a review from boris-ilijic as a code owner July 29, 2025 01:47
@@ -65,7 +66,7 @@ func runConfig(
var o confVals
rsnc := false
for k, v := range c.set {
err := config.SetConfigVar(ctx, conn, k, v)
err := config.SetConfigVar(ctx, ccrsConn, k, v)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is silent but critical bug up in the stack, when PBM fetches cluster time of CCRS, instead of target cluster:

ct, err := topo.GetClusterTime(ctx, m)

m *restore.RestoreMeta,
node string,
status defs.Status,
tskew int64,
) error {
ep, _ := config.GetEpoch(ctx, conn)
ep, _ := config.GetEpoch(ctx, ccrsConn)
l := log.FromContext(ctx).
NewEvent(string(ctrl.CmdRestore), m.Backup, m.OPID, ep.TS())
stg, err := util.GetStorage(ctx, conn, node, l)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be CCRS connection

m *restore.RestoreMeta,
node string,
status defs.Status,
tskew int64,
) error {
ep, _ := config.GetEpoch(ctx, conn)
ep, _ := config.GetEpoch(ctx, ccrsConn)
l := log.FromContext(ctx).
NewEvent(string(ctrl.CmdRestore), m.Backup, m.OPID, ep.TS())
stg, err := util.GetStorage(ctx, conn, node, l)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also this one should use ccrs connection:

rmeta, err = getMeta(ctx, conn, m.Name)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants