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

[PBM-1356] ensure capped collection #1008

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions cmd/pbm-agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,16 @@ func (a *Agent) CanStart(ctx context.Context) error {
return ErrDelayedNode
}

ver, err := version.GetMongoVersion(ctx, a.leadConn.MongoClient())
if err != nil {
return errors.Wrap(err, "get mongo version")
}
if err := version.FeatureSupport(ver).PBMSupport(); err != nil {
return nil
}

func (a *Agent) showIncompatibilityWarning(ctx context.Context) {
if err := version.FeatureSupport(a.brief.Version).PBMSupport(); err != nil {
log.FromContext(ctx).
Warning("", "", "", primitive.Timestamp{}, "WARNING: %v", err)
}

if ver.IsShardedTimeseriesSupported() {
if a.brief.Version.IsShardedTimeseriesSupported() {
tss, err := topo.ListShardedTimeseries(ctx, a.leadConn)
if err != nil {
log.FromContext(ctx).
Expand All @@ -131,8 +131,6 @@ func (a *Agent) CanStart(ctx context.Context) error {
strings.Join(tss, ", "))
}
}

return nil
}

// Start starts listening the commands stream.
Expand Down
2 changes: 2 additions & 0 deletions cmd/pbm-agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ func runAgent(mongoURI string, dumpConns int) error {
return errors.Wrap(err, "setup pbm collections")
}

agent.showIncompatibilityWarning(ctx)

if canRunSlicer {
go agent.PITR(ctx)
}
Expand Down
Loading