mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-6236:Negative ref_cnt of template(snapshot/volume)_store_ref results in out-of-range error in Mysql
(cherry picked from commit cd8af6a3e2)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
Conflicts:
engine/schema/src/org/apache/cloudstack/storage/datastore/db/TemplateDataStoreVO.java
This commit is contained in:
parent
e9d079ace1
commit
38bc20e67f
|
|
@ -350,7 +350,12 @@ public class VolumeDataStoreVO implements StateObject<ObjectInDataStoreStateMach
|
|||
}
|
||||
|
||||
public void setRefCnt(Long refCnt) {
|
||||
this.refCnt = refCnt;
|
||||
if (refCnt > 0) {
|
||||
refCnt--;
|
||||
}
|
||||
else {
|
||||
s_logger.warn("We should not try to decrement a zero reference count even though our code has guarded");
|
||||
}
|
||||
}
|
||||
|
||||
public void incrRefCnt() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue