psa pls don't use transactions for single doc unobserved atomic updates
William Reade
william.reade at canonical.com
Mon Sep 22 07:03:11 UTC 2014
There are a couple of places where we deliberately don't use
transactions, and I'm not *automatically* opposed to skipping them in
certain circumstances, but each such instance does require that we
record a clear justification and explanation for the surprising
approach.
In the case of last-login, for example, I'm not convinced that we
won't want to watch logins in the nearish future; and I'm at best
ambivalent about whether it's legitimate to (say) record a login for a
user that's just been removed (which we can't prevent without txns,
AFAICS).
(And apart from anything else, the set of state changes which don't
need to be observed is not actually very large -- not empty, but IMO
not large enough that the default should be anything but "use a txn".)
Cheers
William
On Mon, Sep 22, 2014 at 7:00 AM, John Meinel <john at arbash-meinel.com> wrote:
>
>
> On Mon, Sep 22, 2014 at 3:00 AM, Tim Penhey <tim.penhey at canonical.com>
> wrote:
>>
>> There is one that I talked with Kapil about this morning.
>>
>> When a user connects over the client api, we record the last login time.
>> Currently this uses a transaction, but doesn't need to. In fact using a
>> transaction here takes an order of magnitude longer, and wakes up
>> watchers when it doesn't need to (because of a new transaction).
>>
>> This is certainly something that is worthwhile looking at, and
>> determining a pattern for.
>>
>> Tim
>>
>
> I hesitate to start getting into a pattern of not using transactions because
> we think we don't need one for this particular operation right now. Because
> stuff that didn't used to need one will likely evolve and then not have one
> when really it should.
>
> While we could certainly do a pass, and evaluate for each thing we are doing
> whether it is necessary, are we stable enough that this isn't just premature
> optimization?
>
> John
> =:->
>
> --
> Juju-dev mailing list
> Juju-dev at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/juju-dev
>
More information about the Juju-dev
mailing list