You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Jeff <je...@gmail.com> on 2017/07/07 18:36:43 UTC

Does the "Query Consistency" feature use MVCC?

Howdy!

I've read through the docs at https://apacheignite.readme.io but couldn't
find a definitive answer (even started diving into the source, but figured
I'd try here before going further).  The following is listed as a feature on
the Apache Ignite Datagrid website:

"Ignite provides full query consistency. Updates that happened after the
query execution started do not affect the query result."

From the docs and JIRA ticket
(https://issues.apache.org/jira/browse/IGNITE-3478), it appears that SQL
queries do not yet support MVCC in relation to DataGrid Transactions (e.g.
If writing A and B in a transaction, able to get new A value but old B
value).

So, for getAll(), ScanQuery, etc. how is this supported?  Is it only when
the cache is set to TRANSACTIONAL?  I tried a quick test which modifies an
object of an ATOMIC cache during the SQL cursor iteration (and small page
size), but the previous value was returned.  Though I'm not sure if there is
an optimization/minimum value on the page size.

Fundamentally, my question is under what conditions (atomicity mode, query
type, etc.) is the query consistency guaranteed and how does Ignite ensure
this (e.g. MVCC, local cache for ongoing queries, etc.)

Thanks,
Jeff





--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Does-the-Query-Consistency-feature-use-MVCC-tp14497.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Does the "Query Consistency" feature use MVCC?

Posted by Jeff <je...@gmail.com>.
Got it; thanks!

On Fri, Jul 7, 2017 at 5:03 PM vkulichenko [via Apache Ignite Users] <
ml+s70518n14512h99@n6.nabble.com> wrote:

> Jeff,
>
> Consistency here means that queries never return partial updates. I.e.
> atomicity is guaranteed. However, queries are always executed outside of
> transactional scope, even if there is a ongoing transaction in the same
> thread. Basically, if transaction commits 2 entries, concurrently executed
> query can get one of the entries in the result and leave the second one out
> of the result. If you use put, get and other key-based operations, all
> locks are acquired accordingly to your isolation and full transactional
> support is provided.
>
> -Val
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://apache-ignite-users.70518.x6.nabble.com/Does-the-Query-Consistency-feature-use-MVCC-tp14497p14512.html
> To unsubscribe from Does the "Query Consistency" feature use MVCC?, click
> here
> <http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=14497&code=amVmZi5sYXZlckBnbWFpbC5jb218MTQ0OTd8LTE5MjU3ODI1NDQ=>
> .
> NAML
> <http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Does-the-Query-Consistency-feature-use-MVCC-tp14497p14517.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Does the "Query Consistency" feature use MVCC?

Posted by vkulichenko <va...@gmail.com>.
Jeff,

Consistency here means that queries never return partial updates. I.e.
atomicity is guaranteed. However, queries are always executed outside of
transactional scope, even if there is a ongoing transaction in the same
thread. Basically, if transaction commits 2 entries, concurrently executed
query can get one of the entries in the result and leave the second one out
of the result. If you use put, get and other key-based operations, all locks
are acquired accordingly to your isolation and full transactional support is
provided.

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Does-the-Query-Consistency-feature-use-MVCC-tp14497p14512.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Does the "Query Consistency" feature use MVCC?

Posted by Jeff <je...@gmail.com>.
Thanks for the quick reply, Val.  To clarify the specific criteria, the
"query consistency" guarantee specifically refers to transactions started
(txStart) as either READ_REPEATABLE or SERIALIZABLE, and uses the put() and
get() APIs; correct?

On Fri, Jul 7, 2017 at 3:13 PM vkulichenko [via Apache Ignite Users] <
ml+s70518n14507h44@n6.nabble.com> wrote:

> Hi Jeff,
>
> Transactional consistency and MVCC is (and always will be) available only
> for transactional caches. But for queries MVCC is not supported at all yet.
> Queries are not enlisted in transactions and therefore you can get dirty
> reads. Full support will be added by the end of the year (hopefully).
>
> -Val
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://apache-ignite-users.70518.x6.nabble.com/Does-the-Query-Consistency-feature-use-MVCC-tp14497p14507.html
> To unsubscribe from Does the "Query Consistency" feature use MVCC?, click
> here
> <http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=14497&code=amVmZi5sYXZlckBnbWFpbC5jb218MTQ0OTd8LTE5MjU3ODI1NDQ=>
> .
> NAML
> <http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Does-the-Query-Consistency-feature-use-MVCC-tp14497p14510.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Does the "Query Consistency" feature use MVCC?

Posted by vkulichenko <va...@gmail.com>.
Hi Jeff,

Transactional consistency and MVCC is (and always will be) available only
for transactional caches. But for queries MVCC is not supported at all yet.
Queries are not enlisted in transactions and therefore you can get dirty
reads. Full support will be added by the end of the year (hopefully).

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Does-the-Query-Consistency-feature-use-MVCC-tp14497p14507.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.