Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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: 11 additions & 0 deletions engine/schema/src/main/java/com/cloud/storage/VolumeVO.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ public class VolumeVO implements Volume {
@Column(name = "id")
long id;

@Column(name = "last_id")
private long lastId;

@Column(name = "name")
String name;

Expand Down Expand Up @@ -677,4 +680,12 @@ public void setExternalUuid(String externalUuid) {
public String getEncryptFormat() { return encryptFormat; }

public void setEncryptFormat(String encryptFormat) { this.encryptFormat = encryptFormat; }

public long getLastId() {
return lastId;
}

public void setLastId(long lastId) {
this.lastId = lastId;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,5 @@ CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.user_data', 'removed', 'datetime COM
UPDATE `cloud`.`configuration` SET
`options` = 'FirstFitRouting,RandomAllocator,TestingAllocator,FirstFitAllocator,RecreateHostAllocator'
WHERE `name` = 'host.allocators.order';

CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('volumes','last_id', 'bigint(20) unsigned DEFAULT NULL');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('volumes','last_id', 'bigint(20) unsigned DEFAULT NULL');
-- Add last_id to the volumes table
CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('volumes','last_id', 'bigint(20) unsigned DEFAULT NULL');

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like maintainers cannot commit/merge suggested changes cc @FelipeM525

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also this should ideally be moved to 4.19.1.0->4.19.2.0 sql path

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Original file line number Diff line number Diff line change
Expand Up @@ -2283,6 +2283,8 @@ private void handlePostMigration(boolean success, Map<VolumeInfo, VolumeInfo> sr
if (success) {
VolumeVO volumeVO = _volumeDao.findById(destVolumeInfo.getId());
volumeVO.setFormat(ImageFormat.QCOW2);
volumeVO.setLastId(srcVolumeInfo.getId());

_volumeDao.update(volumeVO.getId(), volumeVO);

_volumeService.copyPoliciesBetweenVolumesAndDestroySourceVolumeAfterMigration(Event.OperationSuccessed, null, srcVolumeInfo, destVolumeInfo, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1720,6 +1720,7 @@ protected VolumeVO duplicateVolumeOnAnotherStorage(Volume volume, StoragePool po
newVol.setPassphraseId(volume.getPassphraseId());
newVol.setEncryptFormat(volume.getEncryptFormat());
}
newVol.setLastId(volume.getId());
return volDao.persist(newVol);
}

Expand Down