On 8/4/22 18:37, Ilya Maximets wrote:
> Transaction history is used to construct database updates for clients.
> But if the row didn't change it will never be used for monitor updates,
> because ovsdb_monitor_changes_classify() will always return
> OVSDB_CHANGES_NO_EFFECT.  So, ovsdb_monitor_history_change_cb()
> will never add it to the update.
> 
> This condition is very common for rows with references.  While
> processing strong references in ovsdb_txn_adjust_atom_refs() the
> whole destination row will be cloned into transaction just to update
> the reference counter.  If this row will not be changed later in
> the transaction, it will just stay in that state and will be added
> to the transaction history.  Since the data didn't change, both 'old'
> and 'new' datums will be the same and equal to one in the database.
> So, we're keeping 2 copies of the same row in memory and we are
> never using them.  In this case, we should just not add them to the
> transaction history in the first place.
> 
> This change should save some space in the transaction history in case
> of transactions with rows with big number of strong references.
> This should also speed up the processing since we will not clone
> these rows for transaction history and will not count their atoms.
> 
> Testing shows about 5-10% performance improvement in ovn-heater
> test scenarios.
> 
> 'n_atoms' counter for transaction adjusted to count only changed
> rows, so we will have accurate value for a number of atoms in the
> history.
> 
> Signed-off-by: Ilya Maximets <[email protected]>
> ---

Looks good to me, thanks!

Acked-by: Dumitru Ceara <[email protected]>

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to