Skip to content
Open
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
11 changes: 5 additions & 6 deletions p2p/kademlia/store/sqlite/meta_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -539,10 +539,10 @@ func (d *MigrationMetaStore) checkAndExecuteMigration(ctx context.Context) {
log.WithContext(ctx).WithError(err).Error("migration worker: check disk space failed")
}

//if !isLow {
// Disk space is sufficient, stop migration
//return
//}
if !isLow {
//Disk space is sufficient, stop migration
return
}

log.WithContext(ctx).WithField("islow", isLow).Info("Starting data migration")
// Step 1: Fetch pending migrations
Expand Down Expand Up @@ -807,8 +807,7 @@ func (d *MigrationMetaStore) InsertMetaMigrationData(ctx context.Context, migrat
now := time.Now()
for _, key := range keys {
if _, err := stmt.Exec(key, migrationID, now, now); err != nil {
tx.Rollback()
return fmt.Errorf("failed to insert meta migration data: %w", err)
continue
}
}

Expand Down
3 changes: 2 additions & 1 deletion supernode/services/metamigrator/migration_data_identifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (task *MetaMigratorTask) IdentifyMigrationData(ctx context.Context) (err er
log.WithContext(ctx).Info("no stale data found to migrate")
return nil
}
log.WithContext(ctx).WithField("total_keys", totalCount).Info("total-data that needs to migrate has been identified")
log.WithContext(ctx).WithField("total_keys", totalCount).Info("total-data that needs to be migrated has been identified")

numOfBatches := getNumOfBatches(totalCount)
log.WithContext(ctx).WithField("no_of_batches", numOfBatches).Info("batches required to store migration-meta has been calculated")
Expand All @@ -65,6 +65,7 @@ func (task *MetaMigratorTask) IdentifyMigrationData(ctx context.Context) (err er
log.WithContext(ctx).WithField("batch", batchNo).Debug("data added to migration-meta for migration")
}

log.WithContext(ctx).Info("all data that needs to be migrated has been added to meta-migration")
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion supernode/services/metamigrator/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

const (
logPrefix = "MetaMigrator"
defaultMetaMigratorDataIdentifier = 24 * time.Hour
defaultMetaMigratorDataIdentifier = 120 * time.Minute
lowSpaceThresholdGB = 50 // in GB

)
Expand Down