bug 10938: do search includingRemoved when generate the log for the vm state transition. The fix is needed for the specific case when expunge interval is really small, and vm gets expunged right after it's state transitioned to Destroyed, but before the log for state transition is generated

status 10938: resolved fixed
This commit is contained in:
alena 2011-08-02 16:10:23 -07:00
parent f043f63eaa
commit 21afd1785a
1 changed files with 1 additions and 2 deletions

View File

@ -34,7 +34,6 @@ import com.cloud.utils.db.SearchCriteria;
import com.cloud.utils.db.SearchCriteria.Func;
import com.cloud.utils.db.SearchCriteria.Op;
import com.cloud.utils.db.UpdateBuilder;
import com.cloud.vm.UserVmVO;
import com.cloud.vm.VMInstanceVO;
import com.cloud.vm.VirtualMachine;
import com.cloud.vm.VirtualMachine.Event;
@ -281,7 +280,7 @@ public class VMInstanceDaoImpl extends GenericDaoBase<VMInstanceVO, Long> implem
int result = update(vmi, sc);
if (result == 0 && s_logger.isDebugEnabled()) {
VMInstanceVO vo = findById(vm.getId());
VMInstanceVO vo = findByIdIncludingRemoved(vm.getId());
StringBuilder str = new StringBuilder("Unable to update ").append(vo.toString());
str.append(": DB Data={Host=").append(vo.getHostId()).append("; State=").append(vo.getState().toString()).append("; updated=").append(vo.getUpdated()).append("; time=").append(vo.getUpdateTime());
str.append("} New Data: {Host=").append(vm.getHostId()).append("; State=").append(vm.getState().toString()).append("; updated=").append(vmi.getUpdated()).append("; time=").append(vo.getUpdateTime());