Bug #3580
Pithos queries outside transactions cause pooling problems when isolation level is serializable
Status: | Resolved | Start date: | 04/11/2013 | |
---|---|---|---|---|
Priority: | High | Due date: | ||
Assignee: | Sofia Papagiannaki | % Done: | 0% |
|
Category: | Pithos | Spent time: | - | |
Target version: | 0.13.1 |
Description
Reported by cstavr who noticed that his pooled pithos backends
could not "see" changes made before he even got them out of the pool.
The "blindness" is caused by the backend being put in the pool while a
SERIALIZABLE (thus "frozen in time" and non-cachable) transaction was
active but was not properly detected at cleanup.
The pool cleanup fails to detect the transaction because it relies
on the sqlalchemy layer to report if there is an active transaction,
but sqlalchemy does not know of the transaction.
The transaction is not known to sqlalchemy because it was implicitly
created by psycopg2 upon executing a query that is submitted without
starting a transaction through sqlalchemy, first.
spapagian identified the last query to the database before the backend
is returned to the pool, as a Node initialization in the introspection
part of the initialization ModularBackend.
If the transactions are READ COMMITTED there are no symptoms because
the transactions are "cache-able" along with the backend.
Associated revisions
fix trasactionless query in pithos backend init
The query was submitted for execution without any prior transaction
setup, which caused:
1. psycopg2 to implicitly start a transaction
2. the new transaction to remain unknown to the sqlalchemy layer
since it was implicit
3. the pooling cleanup to think that the connection was clean
4. the backend to be pooled with a transaction active
Refs: #3580
Fix trasactionless query in pithos sqlite backend init
Refs: #3580
fix trasactionless query in pithos backend init
The query was submitted for execution without any prior transaction
setup, which caused:
1. psycopg2 to implicitly start a transaction
2. the new transaction to remain unknown to the sqlalchemy layer
since it was implicit
3. the pooling cleanup to think that the connection was clean
4. the backend to be pooled with a transaction active
Refs: #3580
Fix trasactionless query in pithos sqlite backend init
Refs: #3580
History
#1 Updated by Sofia Papagiannaki almost 10 years ago
- Status changed from New to Resolved