[RFC] tdb_traverse_read_lite()

Rusty Russell rusty at ozlabs.org
Tue Mar 5 23:58:41 MST 2013


Volker Lendecke <Volker.Lendecke at SerNet.DE> writes:
> On Tue, Mar 05, 2013 at 01:33:18PM +0100, Stefan (metze) Metzmacher wrote:
>> I'd also prefer a chain traverse function, that could be used
>> in a lot of places to reduce the cleanup costs.

I'm not so sure... what would we want to wait for?  Our dbs these days
have huge hashsizes, so this kind of traversal doesn't block much
activity.  But benchmarks will show...

> While looking closer: The traverse_read_lite code seems to
> not do the fancy locking that the next_hash_chain callback
> assumes. See the big comment regarding empty hash chains in
> the tdb_next_lock routine. Don't we also have to lock at
> least once, like traverse_read_lite does? 

I'm not convinced, but it's easy to change.  It doesn't matter for
vaccuuming.

> Also,
> traverse_lite does not do the "Detect tight infinite loops"
> thing, right?

Yes, I should have left a FIXME there, since it's proven useful in the
past.

> Next one: Attached find an untested patch that makes
> traverse_lite avoid allocating the whole thing. Instead, it
> uses tdb_parse_data. malloc/free are not entirely free, they
> can easily show up in profiles.

Definitely, thanks!

I'm waiting for results from Amitay to see if this is useful for ctdb...

Cheers,
Rusty.


More information about the samba-technical mailing list