( ctx context.Context, upgradeToEpochManager bool, mp format.MutableParameters, rep repo.DirectRepositoryWriter, blobcfg format.BlobStorageConfiguration, requiredFeatures []feature.Required, )
| 112 | } |
| 113 | |
| 114 | func updateRepositoryParameters( |
| 115 | ctx context.Context, |
| 116 | upgradeToEpochManager bool, |
| 117 | mp format.MutableParameters, |
| 118 | rep repo.DirectRepositoryWriter, |
| 119 | blobcfg format.BlobStorageConfiguration, |
| 120 | requiredFeatures []feature.Required, |
| 121 | ) error { |
| 122 | if upgradeToEpochManager { |
| 123 | log(ctx).Info("migrating current indexes to epoch format") |
| 124 | |
| 125 | if err := rep.ContentManager().PrepareUpgradeToIndexBlobManagerV1(ctx); err != nil { |
| 126 | return errors.Wrap(err, "error upgrading indexes") |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | if err := rep.FormatManager().SetParameters(ctx, mp, blobcfg, requiredFeatures); err != nil { |
| 131 | return errors.Wrap(err, "error setting parameters") |
| 132 | } |
| 133 | |
| 134 | if upgradeToEpochManager { |
| 135 | if err := format.WriteLegacyIndexPoisonBlob(ctx, rep.BlobStorage()); err != nil { |
| 136 | log(ctx).Errorf("unable to write legacy index poison blob: %v", err) |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | return nil |
| 141 | } |
| 142 | |
| 143 | func updateEpochParameters(mp *format.MutableParameters, anyChange, upgradeToEpochManager *bool) { |
| 144 | *anyChange = true |
no test coverage detected