On Thu, Dec 15, 2016 at 03:59:34PM -0600, Marcelo E. Magallon wrote:
> The RFC contains this:
>
> If "ephemeral" is specified as true, then this column's values
> are not guaranteed to be durable; they may be lost when the
> database restarts. A column whose type (either key or value) is
> a strong reference to a table that is not part of the root set
> is always durable, regardless of this value. (Otherwise,
> restarting the database could lose entire rows.)
>
> I would like to understand why it was decided that a strong reference to
> a non-root table is always durable.
>
> I can understand the comment about the database losing rows, but from
> where I stands, this looks like if you don't want to happen, then the
> solution is to not mark the reference as ephemeral.
>
> This is actually implemented in the code: when OVSDB loads the schema,
> it looks at the reference and marks the column as durable, so the rest
> of the code behaves as if the ephemeral attribute was never there.
>
> Am I missing something really obvious besides the comment in the RFC?
This was implemented because it led to databases that couldn't be read
from disk upon restart. The code comment gives more of the story:
+ if (ovsdb_base_type_is_strong_ref(base) && !refTable->is_root) {
+ /* We cannot allow a strong reference to a non-root table to be
+ * ephemeral: if it is the only reference to a row, then replaying the
+ * database log from disk will cause the referenced row to be deleted,
+ * even though it did exist in memory. If there are references to that
+ * row later in the log (to modify it, to delete it, or just to point
+ * to it), then this will yield a transaction error. */
+ column->persistent = true;
+ }
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev