<feed xmlns='http://www.w3.org/2005/Atom'>
<title>samba.git/lib/ldb/ldb_tdb, branch talloc-2.3.4</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/'/>
<entry>
<title>lib ldb key value backends: Add nested txn support</title>
<updated>2019-06-21T04:27:12+00:00</updated>
<author>
<name>Gary Lockyer</name>
<email>gary@catalyst.net.nz</email>
</author>
<published>2019-03-06T21:18:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=d7dc4fde4080513e2a62fabbdeee546bd74b9a0d'/>
<id>d7dc4fde4080513e2a62fabbdeee546bd74b9a0d</id>
<content type='text'>
Add limited nested transaction support to the back ends to make the key value
operations atomic (for those back ends that support nested transactions).

Note: that only the lmdb backend currently supports nested transactions.

Signed-off-by: Gary Lockyer &lt;gary@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add limited nested transaction support to the back ends to make the key value
operations atomic (for those back ends that support nested transactions).

Note: that only the lmdb backend currently supports nested transactions.

Signed-off-by: Gary Lockyer &lt;gary@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ldb: Fix segfault parsing new pack formats</title>
<updated>2019-05-29T04:41:24+00:00</updated>
<author>
<name>Andrew Bartlett</name>
<email>abartlet@samba.org</email>
</author>
<published>2019-05-22T04:38:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=a3101b9704f554a350493553336cbbbd7d4ae02e'/>
<id>a3101b9704f554a350493553336cbbbd7d4ae02e</id>
<content type='text'>
We need to check for the errors given by ldb_unpack() et al by preserving
the error code from kv_ctx-&gt;parser() called by tdb_parse_record() in
ltdb_parse_record().

Otherwise we will silently accept corrupt records and segfault later.

Likewise new pack formats will confuse the parser but not be
detected except by the incomplete struct ldb_message.

With this patch, the user will see a message like:

 Invalid data for index  DN=@BASEINFO

 Failed to connect to 'st/ad_dc/private/sam.ldb' with backend 'tdb': Unable to load ltdb cache records for backend 'ldb_tdb backend'
 Failed to connect to st/ad_dc/private/sam.ldb - Unable to load ltdb cache records for backend 'ldb_tdb backend'

This can be refined in the future by a specific check for
pack format versions in a higher caller, but this much is
needed regardless to detect corrupt records.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13959

Signed-off-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
Reviewed-by: Garming Sam &lt;garming@catalyst.net.nz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We need to check for the errors given by ldb_unpack() et al by preserving
the error code from kv_ctx-&gt;parser() called by tdb_parse_record() in
ltdb_parse_record().

Otherwise we will silently accept corrupt records and segfault later.

Likewise new pack formats will confuse the parser but not be
detected except by the incomplete struct ldb_message.

With this patch, the user will see a message like:

 Invalid data for index  DN=@BASEINFO

 Failed to connect to 'st/ad_dc/private/sam.ldb' with backend 'tdb': Unable to load ltdb cache records for backend 'ldb_tdb backend'
 Failed to connect to st/ad_dc/private/sam.ldb - Unable to load ltdb cache records for backend 'ldb_tdb backend'

This can be refined in the future by a specific check for
pack format versions in a higher caller, but this much is
needed regardless to detect corrupt records.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13959

Signed-off-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
Reviewed-by: Garming Sam &lt;garming@catalyst.net.nz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ldb: removing unnecessary module pointer</title>
<updated>2019-05-22T04:42:29+00:00</updated>
<author>
<name>Aaron Haslett</name>
<email>aaronhaslett@catalyst.net.nz</email>
</author>
<published>2019-05-15T22:53:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=64cdd0383f9083d84d38dd19168b013906ca9cf8'/>
<id>64cdd0383f9083d84d38dd19168b013906ca9cf8</id>
<content type='text'>
We want to reuse the reindex context struct for repacking, but it has an
unnecessary module pointer on it. Turns out the existing code doesn't
need it either, so this patch deletes the pointer.

Signed-off-by: Aaron Haslett &lt;aaronhaslett@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
Reviewed-by: Gary Lockyer &lt;gary@catalyst.net.nz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We want to reuse the reindex context struct for repacking, but it has an
unnecessary module pointer on it. Turns out the existing code doesn't
need it either, so this patch deletes the pointer.

Signed-off-by: Aaron Haslett &lt;aaronhaslett@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
Reviewed-by: Gary Lockyer &lt;gary@catalyst.net.nz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ldb_kv: Avoid memdup of database records in the case of base searches</title>
<updated>2019-04-11T04:17:11+00:00</updated>
<author>
<name>Garming Sam</name>
<email>garming@catalyst.net.nz</email>
</author>
<published>2019-03-07T03:45:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=a76d2865372988c29baef42ecc4257e861692e7b'/>
<id>a76d2865372988c29baef42ecc4257e861692e7b</id>
<content type='text'>
This makes LDAP bind significantly faster in the case of having many
members, due to large size of these records (with tens of thousands of
member links). During the nested group calculation, you are only
interested in memberOf not the member links.

(We add a bit-field to determine whether or not the backend actually
supports pointing into database memory. For some reason TDB pointers
aren't stable, so for now we set this option just on LMDB backends.)

Signed-off-by: Garming Sam &lt;garming@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This makes LDAP bind significantly faster in the case of having many
members, due to large size of these records (with tens of thousands of
member links). During the nested group calculation, you are only
interested in memberOf not the member links.

(We add a bit-field to determine whether or not the backend actually
supports pointing into database memory. For some reason TDB pointers
aren't stable, so for now we set this option just on LMDB backends.)

Signed-off-by: Garming Sam &lt;garming@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lmdb: iterate_range implementation</title>
<updated>2019-04-08T02:07:22+00:00</updated>
<author>
<name>Garming Sam</name>
<email>garming@catalyst.net.nz</email>
</author>
<published>2019-03-03T23:50:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=e4ea408f52eeb958f646dfa4ef304357a080bdd1'/>
<id>e4ea408f52eeb958f646dfa4ef304357a080bdd1</id>
<content type='text'>
Adding iterate_range to LDB API and implementing in LMDB.  This
operation takes a start_key and end_key and returns all records between
the two, inclusive of both.  This will be used to implementing indexing
for &lt;= and &gt;= expressions.

Signed-off-by: Garming Sam &lt;garming@catalyst.net.nz&gt;
Signed-off-by: Aaron Haslett &lt;aaronhaslett@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Adding iterate_range to LDB API and implementing in LMDB.  This
operation takes a start_key and end_key and returns all records between
the two, inclusive of both.  This will be used to implementing indexing
for &lt;= and &gt;= expressions.

Signed-off-by: Garming Sam &lt;garming@catalyst.net.nz&gt;
Signed-off-by: Aaron Haslett &lt;aaronhaslett@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib ldb key_value: Add get_size method</title>
<updated>2019-04-04T06:40:17+00:00</updated>
<author>
<name>Gary Lockyer</name>
<email>gary@catalyst.net.nz</email>
</author>
<published>2019-04-01T02:27:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=6129a05ca0cc39a8043d58f793c4ec92e4c40182'/>
<id>6129a05ca0cc39a8043d58f793c4ec92e4c40182</id>
<content type='text'>
Add the get_size method to the ldb_key_value layer, this will allow the
reindexing code to get an estimate of the number of records in the
database.

The lmdb backend returns an accurate count of the number of records in
the database withe the mdb_env_stat call.

The tdb backend does not provide a low cost method to determine the
number of records on the database.  It does provide a tdb_summary call
however this this walks the entire database.

So for tdb we use the map size divided by 500, this over estimates the counts
for small domains, but the extra memory allocated for the cache should
not be significant.

Signed-off-by: Gary Lockyer &lt;gary@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add the get_size method to the ldb_key_value layer, this will allow the
reindexing code to get an estimate of the number of records in the
database.

The lmdb backend returns an accurate count of the number of records in
the database withe the mdb_env_stat call.

The tdb backend does not provide a low cost method to determine the
number of records on the database.  It does provide a tdb_summary call
however this this walks the entire database.

So for tdb we use the map size divided by 500, this over estimates the counts
for small domains, but the extra memory allocated for the cache should
not be significant.

Signed-off-by: Gary Lockyer &lt;gary@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib ldb: move key value code to lib/ldb/ldb_key_value</title>
<updated>2018-07-30T12:31:54+00:00</updated>
<author>
<name>Gary Lockyer</name>
<email>gary@catalyst.net.nz</email>
</author>
<published>2018-07-22T22:02:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=19be0be232c25250e79dc313fd43829de049b491'/>
<id>19be0be232c25250e79dc313fd43829de049b491</id>
<content type='text'>
Move the key value code to a separate subdirectory.

Signed-off-by: Gary Lockyer &lt;gary@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Move the key value code to a separate subdirectory.

Signed-off-by: Gary Lockyer &lt;gary@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib ldb: rename ltdb_parse_data_unpack_ctx</title>
<updated>2018-07-30T12:31:54+00:00</updated>
<author>
<name>Gary Lockyer</name>
<email>gary@catalyst.net.nz</email>
</author>
<published>2018-07-20T01:50:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=67c055406c7ad6b92c89337acd72a751962e99f0'/>
<id>67c055406c7ad6b92c89337acd72a751962e99f0</id>
<content type='text'>
Rename ltdb_parse_data_unpack_ctx to ldb_kv_parse_data_unpack_ctx, as
it's a key value level structure and not ltdb specific.

Signed-off-by: Gary Lockyer &lt;gary@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Rename ltdb_parse_data_unpack_ctx to ldb_kv_parse_data_unpack_ctx, as
it's a key value level structure and not ltdb specific.

Signed-off-by: Gary Lockyer &lt;gary@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib ldb: remove unused function prototypes</title>
<updated>2018-07-30T12:31:54+00:00</updated>
<author>
<name>Gary Lockyer</name>
<email>gary@catalyst.net.nz</email>
</author>
<published>2018-07-20T01:47:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=9191d3baf513f9cd2d15206f1378c24a5e7de2e3'/>
<id>9191d3baf513f9cd2d15206f1378c24a5e7de2e3</id>
<content type='text'>
Remove unused function prototypes

Signed-off-by: Gary Lockyer &lt;gary@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove unused function prototypes

Signed-off-by: Gary Lockyer &lt;gary@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib ldb: rename ltdb_idxptr to ldb_kv_idxptr</title>
<updated>2018-07-30T12:31:54+00:00</updated>
<author>
<name>Gary Lockyer</name>
<email>gary@catalyst.net.nz</email>
</author>
<published>2018-07-20T01:40:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=d3bfd374a65b93f5a7d9f3bf3c356871a5879a12'/>
<id>d3bfd374a65b93f5a7d9f3bf3c356871a5879a12</id>
<content type='text'>
Rename ltdb_idxptr to ldb_kv_idxptr as it's key value level and not tdb
specific.

Signed-off-by: Gary Lockyer &lt;gary@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Rename ltdb_idxptr to ldb_kv_idxptr as it's key value level and not tdb
specific.

Signed-off-by: Gary Lockyer &lt;gary@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
