durusmail: durus-users: Nervous about explicitelly calling cache "shrink"
Nervous about explicitelly calling cache "shrink"
2006-06-20
2006-06-20
2006-06-25
Nervous about explicitelly calling cache "shrink"
Jesus Cea
2006-06-20
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I've been nervous about explicitelly calling cache "shrink" in the
middle of a transaction. In fact I documented some issues in
http://www.argo.es/~jcea/artic/know_how-durus-3_3.htm , section "Durus
Storage Server conflicts".

Rewriting that section to cope with changes in conflict detection logic
in Durus 3.4 I see the following issue:

1. Suppose the cache is full.
2. Suppose I touched a lot of objects in current transaction. For
example, all the cache content.
3. Suppose I do an explicit cache "shrink".

Durus cache logic could move to ghost state objects involved in current
transaction (still in progress). Not an issue for them, because the
"_p_touched" attribute, used in conflict detection, is still present
even if the object is a ghost.

But suppose that the "ghosted" object was the only reference to another
just touched object. Now that object is orphan, since its reference
vanished when its parent was "ghosted". So when the cache
weakref/strongref magic reaches that object, it will be disposed EVEN IF
IT WAS IN USE IN CURRENT TRANSACTION. If other client modifies that
object remotely, the conflict will be UNNOTICED when we do the
"commit()", since that object is not in the cache; it was purged.

Argggggg :-).

I guess the simple solution would be to leave alone objects in cache
involved in current transaction.

PS: "Shrink" is not a problem in the "commit()"/"abort()" case because
it is done when the transaction already finished.

- --
Jesus Cea Avion                         _/_/      _/_/_/        _/_/_/
jcea@argo.es http://www.argo.es/~jcea/ _/_/    _/_/  _/_/    _/_/  _/_/
jabber / xmpp:jcea@jabber.org         _/_/    _/_/          _/_/_/_/_/
                               _/_/  _/_/    _/_/          _/_/  _/_/
"Things are not so easy"      _/_/  _/_/    _/_/  _/_/    _/_/  _/_/
"My name is Dump, Core Dump"   _/_/_/        _/_/_/      _/_/  _/_/
"El amor es poner tu felicidad en la felicidad de otro" - Leibniz
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQCVAwUBRJgQkplgi5GaxT1NAQJWkAQAiyqRU8nae3f+wk2p/c2OzH+FYQqYYmhG
Zifl0CgY6Pxna/G9otlVNzJjpltysi2AKSlxcisuCPDmR/24pKKsmbsfWx5dI/B2
pTPAZv8YQdZlI8Oik9YXBRQ7TxEluPA2CzRKRAn0Olm3p6tGy27upeg0xdfNTk0v
Sz1O4l7WVeQ=
=aJW3
-----END PGP SIGNATURE-----
reply