Skip to content

Commit

Permalink
add -tpool saving map
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Sergunov <anton.sergunov@flant.com>
  • Loading branch information
asergunov committed Feb 26, 2025
1 parent 5220bd9 commit b21b435
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions images/agent/src/internal/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func (c *Cache) FindVG(vgName string) *internal.VGData {
return nil
}

func (c *Cache) FindThinPoolMappers(thinLvData *LVData) (poolMapper, poolMetadataMapper string, err error) {
func (c *Cache) FindThinPoolMappers(thinLvData *LVData) (tpool, poolMetadataMapper string, err error) {
if thinLvData.Data.PoolName == "" {
err = fmt.Errorf("pool name is empty")
return
Expand All @@ -163,7 +163,7 @@ func (c *Cache) FindThinPoolMappers(thinLvData *LVData) (poolMapper, poolMetadat
return
}

poolMapper = poolLv.Data.LVDmPath
tpool = fmt.Sprintf("%s-tpool", poolLv.Data.LVDmPath)

if poolLv.Data.MetadataLv == "" {
err = fmt.Errorf("metadata name is empty for pool %s", thinLvData.Data.PoolName)
Expand Down
4 changes: 2 additions & 2 deletions images/agent/src/internal/controller/llv/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -598,14 +598,14 @@ func (r *Reconciler) deleteLVIfNeeded(ctx context.Context, vgName string, llv *v
}
var usedRanges *utils.RangeCover
if lv.Data.PoolName != "" {
poolMapper, poolMetadataMapper, err := r.sdsCache.FindThinPoolMappers(lv)
tpool, poolMetadataMapper, err := r.sdsCache.FindThinPoolMappers(lv)
if err != nil {
err = fmt.Errorf("finding mappers for thin pool %s: %w", lv.Data.PoolName, err)
r.log.Error(err, fmt.Sprintf("[deleteLVIfNeeded] can't find pool for LV %s in VG %s", llv.Spec.ActualLVNameOnTheNode, vgName))
return true, err
}

superblock, err := utils.ThinDump(ctx, r.log, poolMapper, poolMetadataMapper)
superblock, err := utils.ThinDump(ctx, r.log, tpool, poolMetadataMapper)
if err != nil {
err = fmt.Errorf("dumping thin pool map: %w", err)
r.log.Error(err, fmt.Sprintf("[deleteLVIfNeeded] can't find pool map for LV %s in VG %s", llv.Spec.ActualLVNameOnTheNode, vgName))
Expand Down

0 comments on commit b21b435

Please sign in to comment.