Skip to content

Commit fada14f

Browse files
committed
nil guard and comment update
1 parent 06595ea commit fada14f

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

base/bootstrap.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ type BootstrapConnection interface {
5252
// for the given bucket; subsequent bootstrap reads for that bucket stop falling back to
5353
// _default._default. Per-bucket so completing one bucket never disables another's fallback.
5454
SetMigrationComplete(bucketName string)
55-
// IsMigrationComplete returns true if bootstrap-metadata migration to _system._mobile has finished for the given bucket
55+
// IsMigrationComplete reports whether this process has marked bootstrap-metadata migration complete for the given bucket (local cache).
5656
IsMigrationComplete(bucketName string) bool
5757
// GetMetadataMigrationStatus reads the bucket-level metadata-migration status doc directly from
5858
// _system._mobile (never via the dual-collection wrapper). Returns ErrNotFound when the doc has

rest/server_context.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2403,9 +2403,12 @@ func (sc *ServerContext) initializeBootstrapConnection(ctx context.Context) erro
24032403
return nil
24042404
}
24052405

2406-
// RecheckPendingBucketMetadataMigrations will iterate through all buckets and check if any bucket metadata migrations
2407-
// still in pending state can now be moved into in_progress state.
2406+
// RecheckPendingBucketMetadataMigrations iterates through all config buckets and re-evaluates
2407+
// whether bucket-level metadata migration can now be completed.
24082408
func (sc *ServerContext) RecheckPendingBucketMetadataMigrations(ctx context.Context) {
2409+
if sc.BootstrapContext == nil || sc.BootstrapContext.Connection == nil {
2410+
return
2411+
}
24092412
buckets, err := sc.BootstrapContext.Connection.GetConfigBuckets(ctx)
24102413
if err != nil {
24112414
base.WarnfCtx(ctx, "Couldn't list buckets to re-check bucket metadata migration: %v", err)

0 commit comments

Comments
 (0)