-- Álvaro Hernández Tortosa ----------- 8Kdata
--
You received this message because you are subscribed to the Google Groups "Greenplum Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gpdb-dev+u...@greenplum.org.
Andreas Scherbaum
Principal Software Engineer
GoPivotal Deutschland GmbH
Amtsgericht Königstein im Taunus, HRB 8433
Geschäftsführer: Andrew Michael Cohen, Paul Thomas Dacier
On Wed, Nov 11, 2015 at 11:36 AM, Álvaro Hernández Tortosa <a...@8kdata.com> wrote:
>
>
> If I may add to the debate, having REPEATABLE READ isolation level is something really important for many, us (ToroDB) included. SERIALIZABLE would be great, but it is not common need. So PostgreSQL's pre-9.1 SERIALIZABLE which is not such but greater than REPEATABLE READ is probably good enough.
>
Just curious, how does ToroDB depend on repeatable read isolation level?
Greenplum's catalog checker (gpcheckcat) that Ashwin alluded to, compares catalog tables on master with those on segments. Serializable isolation level is used to guarantee that the tool reads the same catalog contents on mater and segments, even if transactions commit after it started reading.
Prior to when SSI was introduced, did PostgreSQL differentiate between repeatable read and serializable isolation levels? If yes, can someone please elaborate how?
As you know, we implement MongoDB's wire protocol. This protocol is session-less. When you issue a query and not all the results fit in the response, you retain a cursor reference. Subsequent queries may use this cursor to fetch more results. The problem is that these queries to fetch more data, being the protocol session-less, cannot be tied to a user-facing tx. In order for us to provide consistent reads, we open an "internal" cursor reading off a REPEATABLE READ READONLY tx and use that cursor for subsequent MongoDB fetches. READ COMMITTED is not enough for us as we might see new data committed before each new "fetch more" MongoDB wire protocol message.
If either RR or Serializable are effectively provided and they work, we are good with either. But I understood that as of today RR is not provided and Serializable may not be perfectly implemented, is that right?
" Note: Prior to PostgreSQL version 9.1, a request for the Serializable transaction isolation level provided exactly the same behavior described here. To retain the legacy Serializable behavior, Repeatable Read should now be requested."
http://www.postgresql.org/docs/9.4/static/transaction-iso.html
On Wed, Nov 11, 2015 at 4:05 PM, Álvaro Hernández Tortosa <a...@8kdata.com> wrote:
As you know, we implement MongoDB's wire protocol. This protocol is session-less. When you issue a query and not all the results fit in the response, you retain a cursor reference. Subsequent queries may use this cursor to fetch more results. The problem is that these queries to fetch more data, being the protocol session-less, cannot be tied to a user-facing tx. In order for us to provide consistent reads, we open an "internal" cursor reading off a REPEATABLE READ READONLY tx and use that cursor for subsequent MongoDB fetches. READ COMMITTED is not enough for us as we might see new data committed before each new "fetch more" MongoDB wire protocol message.
Cursors in Greenplum behave similar to repeatable read transactions. E.g. let transaction T1 open a cursor as "declare c cursor for select * from r1;". While T1 fetches from cursor c, another transaction, T2 may insert / update / delete tuples from table r1. But T1 continues to see the version of r1 when it was started. I just verified that the same behavior is exhibited in PostgreSQL 9.4.
Isn't this behavior sufficient for your use case? Or am I missing something obvious?
If either RR or Serializable are effectively provided and they work, we are good with either. But I understood that as of today RR is not provided and Serializable may not be perfectly implemented, is that right?
That is correct. But please note that Greenplum's serializable isolation mode is not broken outrightly. E.g. read only serializable transactions behave as expected.