Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 881783 - ovrit-engine-backend:.rollbackQuota ignores disabled quota
ovrit-engine-backend:.rollbackQuota ignores disabled quota
Status: CLOSED ERRATA
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine (Show other bugs)
3.1.0
x86_64 Linux
medium Severity medium
: ---
: 3.1.2
Assigned To: ofri
Ido Begun
sla
: ZStream
Depends On: 880169
Blocks:
  Show dependency treegraph
 
Reported: 2012-11-29 10:08 EST by Chris Pelland
Modified: 2016-02-10 15:18 EST (History)
14 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Previously, when StopVmCommandBase was called the rollbackQuota called the DB too many times. The rollBackQuota method was changed so that the vm disks would be fetched from DB only if the VM is stateless and the quota is enabled.
Story Points: ---
Clone Of: 880169
Environment:
Last Closed: 2013-02-04 18:34:20 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: SLA
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:0211 normal SHIPPED_LIVE Moderate: rhevm 3.1.2 security and bug fix update 2013-02-04 23:53:00 EST

  None (edit)
Description Chris Pelland 2012-11-29 10:08:19 EST
+++ This bug was initially created as a clone of Bug #880169 +++

ovrit-engine-backend[scalability]:.rollbackQuota query twice DiskDaoDbFacadeImpl.getAllForVm for vmAction when quota is disabled.

Scenario:
*********
1) Disable DC quota (default quota value is disabled).
2) Create VM (Make sure It's Nota stateless VM).
3) Attempt to runVM  .
4) Attempt to StopVM.
5) Check the thread dump :  
   - > /var/log/ovirt-engine/console.log
   -   kill -3 `pgrep java' 
   -   less /var/log/ovirt-engine/console.log
   -   search for '.rollbackQuota'

Results:
*******
A) .rollbackQuota is querying twice ".DiskDaoDbFacadeImpl.getAllForVm" for each vmAction.  
B) .rollbackQuota should call those queries only when:
    - Quota is enabled on DC. 
    - The VMs are stateless. 

console.log :
************
"pool-4-thread-5" prio=10 tid=0x00007f2a14009800 nid=0x4003 runnable [0x00007f29fbbb9000]
   java.lang.Thread.State: RUNNABLE
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:150)
        at java.net.SocketInputStream.read(SocketInputStream.java:121)
        at org.postgresql.core.VisibleBufferedInputStream.readMore(VisibleBufferedInputStream.java:135)
        at org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:104)
        at org.postgresql.core.VisibleBufferedInputStream.read(VisibleBufferedInputStream.java:73)
        at org.postgresql.core.PGStream.ReceiveChar(PGStream.java:259)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1620)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
        - locked <0x00000000c3ef8660> (a org.postgresql.core.v3.QueryExecutorImpl)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:367)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:271)
        at org.jboss.jca.adapters.jdbc.CachedPreparedStatement.executeQuery(CachedPreparedStatement.java:107)
        at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:462)
        at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:644)
        at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:587)
        at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:637)
        at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:666)
        at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:706)
        at org.ovirt.engine.core.dal.dbbroker.PostgresDbEngineDialect$PostgresSimpleJdbcCall.executeCallInternal(PostgresDbEngineDialect.java:155)
        at org.ovirt.engine.core.dal.dbbroker.PostgresDbEngineDialect$PostgresSimpleJdbcCall.doExecute(PostgresDbEngineDialect.java:121)
        at org.springframework.jdbc.core.simple.SimpleJdbcCall.execute(SimpleJdbcCall.java:181)
        at org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.executeImpl(SimpleJdbcCallsHandler.java:124)
at org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.executeReadAndReturnMap(SimpleJdbcCallsHandler.java:75)
        at org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.executeReadList(SimpleJdbcCallsHandler.java:66)
        at org.ovirt.engine.core.dao.DiskDaoDbFacadeImpl.getAllForVm(DiskDaoDbFacadeImpl.java:31)
        at org.ovirt.engine.core.dao.DiskDaoDbFacadeImpl.getAllForVm(DiskDaoDbFacadeImpl.java:24)
        at org.ovirt.engine.core.bll.VmHandler.updateDisksFromDb(VmHandler.java:253)
        at org.ovirt.engine.core.bll.StopVmCommandBase.rollbackQuota(StopVmCommandBase.java:251)
        at org.ovirt.engine.core.bll.StopVmCommandBase.setSucceeded(StopVmCommandBase.java:276)
        at org.ovirt.engine.core.bll.ShutdownVmCommand.Perform(ShutdownVmCommand.java:89)
        at org.ovirt.engine.core.bll.VmOperationCommandBase.ExecuteVmCommand(VmOperationCommandBase.java:34)
        at org.ovirt.engine.core.bll.StopVmCommandBase.ExecuteVmCommand(StopVmCommandBase.java:95)
        at org.ovirt.engine.core.bll.VmCommand.executeCommand(VmCommand.java:78)
        at org.ovirt.engine.core.bll.CommandBase.executeWithoutTransaction(CommandBase.java:876)
        at org.ovirt.engine.core.bll.CommandBase.executeActionInTransactionScope(CommandBase.java:973)
        at org.ovirt.engine.core.bll.CommandBase.runInTransaction(CommandBase.java:1372)
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInSuppressed(TransactionSupport.java:168)
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInScope(TransactionSupport.java:107)
        at org.ovirt.engine.core.bll.CommandBase.execute(CommandBase.java:991)
        at org.ovirt.engine.core.bll.CommandBase.executeAction(CommandBase.java:291)
        at org.ovirt.engine.core.bll.MultipleActionsRunner.executeValidatedCommands(MultipleActionsRunner.java:182)
        at org.ovirt.engine.core.bll.MultipleActionsRunner.RunCommands(MultipleActionsRunner.java:162)
        at org.ovirt.engine.core.bll.MultipleActionsRunner$1.run(MultipleActionsRunner.java:84)
        at org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil$InternalWrapperRunnable.run(ThreadPoolUtil.java:64)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:722)

--- Additional comment from Omri Hochman on 2012-11-26 07:28:56 EST ---

Created attachment 651934 [details]
console.log

--- Additional comment from Doron Fediuck on 2012-11-26 07:43:49 EST ---

(In reply to comment #0)

(snip)

> 
> Results:
> *******
> A) .rollbackQuota is querying twice ".DiskDaoDbFacadeImpl.getAllForVm" for
> each vmAction.  

Need verification on this item.

> B) .rollbackQuota should call those queries only when:
>     - Quota is enabled on DC. 

Agreed.

>     - The VMs are stateless. 
> 

Not exactly. The storage part should be handled only for stateless. Otherwise
each stopped VM needs to release the run-time quota, so roll-back is needed.

--- Additional comment from Doron Fediuck on 2012-11-26 11:29:36 EST ---

(In reply to comment #2)
> (In reply to comment #0)
 
(snip)
 
> > 
> > Results:
> > *******
> > A) .rollbackQuota is querying twice ".DiskDaoDbFacadeImpl.getAllForVm" for
> > each vmAction.  
> 
> Need verification on this item.
> 

After checking it, this is a misunderstanding, since we have function overloading. No need for a fix here.

> > B) .rollbackQuota should call those queries only when:
> >     - Quota is enabled on DC. 
> 
> Agreed.
> 

The only fix needed here is check for quota state (ie0 not disabled), and improve by handling storage just for stateless VMs.

--- Additional comment from Doron Fediuck on 2012-11-26 11:34:46 EST ---

Removed the 3.2 flag, as this issue is relevant for 3.1.z only.
In 3.2 we have quota improvements which removed these code parts.

--- Additional comment from Simon Grinberg on 2012-11-27 09:14:43 EST ---

(In reply to comment #4)
> Removed the 3.2 flag, as this issue is relevant for 3.1.z only.
> In 3.2 we have quota improvements which removed these code parts.

Still has to have the flag for QE to verify there is no regression.
Comment 1 Doron Fediuck 2012-11-29 10:59:08 EST
Proposed patch:
https://gerrit.eng.lab.tlv.redhat.com/#/c/3500/
Comment 5 errata-xmlrpc 2013-02-04 18:34:20 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2013-0211.html

Note You need to log in before you can comment on or make changes to this bug.