Are there any handles of DB transaction of current version Quantum?

Asked by Havent

Currently, run an instance for example, will write the DB several times, if there aren't DB transactions between these DB writings, there may be many problems after that. So are there any handlings or plans to use DB transaction to avoid such problems?

Question information

Language:
English Edit question
Status:
Solved
For:
neutron Edit question
Assignee:
No assignee Edit question
Solved by:
Salvatore Orlando
Solved:
Last query:
Last reply:
Revision history for this message
Salvatore Orlando (salvatore-orlando) said :
#1

Hi Havent,

I am not sure if I got your question right. I will try to answer anyway!

In Quantum we strive to ensure that each API operation are ACID wrt the DB. Should there be operations which do not respect these properties, Atomicity in particular, that would be a bug, and should definitely be raised.

For more convoluted tasks involving several Quantum operations, such as spawning an instance, I am not sure whether an approach based on DB transactions would be actually feasible - and if yes, I am not convinced this is the kind of behaviour one would expect from a REST API.
As you might already have seen the allocate_for_instance call in nova.network.api.quantumv2 has some code for ensuring instance creation is performed in an atomic and consistent way. I agree this is not the way one would like to do this, and we'll certainly improve it for Folsom-3.

Please have a look at this bug report, and let me know if this is kind of thing you would be expecting from the tasks performing several operations on the API: https://bugs.launchpad.net/quantum/+bug/1020639

Revision history for this message
Havent (guestly) said :
#2

Thanks Salvatore,
Batch API create/delete as the bug report says is one aspect of the problem of integrity of data. But I mentioned in my question is just one API call. It may be involved serial DB APIs call, and I mean these DB APIs call should act atomicly.

Revision history for this message
Best Salvatore Orlando (salvatore-orlando) said :
#3

Havent,

Within a single API operation, we definitely want to respect atomicity, as
well as all the ACID properties, and that is what we are striving for.
If you reckon that there are operations for which the behavior is not
atomic please file a bug for them as that would be something that
definitely needs to be fixed, as stated in my previous answer.

Thanks,
Salvatore

On 8 July 2012 18:21, Havent <email address hidden> wrote:

> Question #202407 on quantum changed:
> https://answers.launchpad.net/quantum/+question/202407
>
> Status: Answered => Open
>
> Havent is still having a problem:
> Thanks Salvatore,
> Batch API create/delete as the bug report says is one aspect of the
> problem of integrity of data. But I mentioned in my question is just one
> API call. It may be involved serial DB APIs call, and I mean these DB APIs
> call should act atomicly.
>
> --
> You received this question notification because you are a member of
> Netstack Core Developers, which is an answer contact for quantum.
>

Revision history for this message
Havent (guestly) said :
#4

Thanks Salvatore Orlando, that solved my question.