-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue 6430 - implement read-only bdb #6431
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The overall looks good. Few comments
#include "bdb_layer.h" | ||
#include <robdb.h> | ||
|
||
#define DEBUG 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be 0 by default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should not even be defined at all (since we are using #ifdef)
{ | ||
int rc = bdbreader_cur_lookup(db->cur->impl, key->data, key->size); | ||
if (rc == DB_SUCCESS) { | ||
rc = dbc_get(db->cur, key, data, flags); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it call db->cur->c_get than dbc_get ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
db->cur->c_get == dbc_get so it does not really matter.
But to respect the layered approach since we are in the glue code that maps bdb API to robdb API,
bdb_bdbreader_glue.c code should use either internal or librobdb function rather than the bdb API
(So dbc_get looks good.)
@@ -397,6 +397,7 @@ const char *dblayer_op2str(dbi_op_t op) | |||
return str[idx]; | |||
} | |||
|
|||
<<<<<<< HEAD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably a leftover from a merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed: bad conflict resolution when rebasing to main ...
|
||
int dbc_close(DBC *dbc) | ||
{ | ||
bdbreader_bdb_close(dbc->impl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean bdbreader_cur_close ?
Fixed review cooments about DEBUG, bdbreader_cur_close, and rebase conflict issue |
rpm/389-ds-base.spec.in
Outdated
@@ -540,11 +582,11 @@ if ! make DESTDIR="$RPM_BUILD_ROOT" check; then cat ./test-suite.log && false; f | |||
|
|||
%post | |||
if [ -n "$DEBUGPOSTTRANS" ] ; then | |||
output=$DEBUGPOSTTRANS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation was removed here and below, is this intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
lib/librobdb/robdb.spec
Outdated
Summary: Provide basic functions to search and read Berkeley Database records | ||
|
||
License: GPL-2.0-or-later | ||
URL: https://github.com/389ds/389-ds-base/lib/librobdb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Broken URL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is expected:
Right now, lib/librobdb does not exists yet on main branch, but it will exist once the PR get merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then it would be something like this (note the tree
and main
branch in the URL):
https://github.com/389ds/389-ds-base/tree/main/lib/librobdb
%doc %{_defaultdocdir}/%{name}-devel/README.md | ||
%{_libdir}/*.so | ||
%{_includedir}/* | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since there is test.c for robdb, maybe we should run it as part of %check
section?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a make localtest to be able to run the test without having to install the rpm first
and added a %check section to use it
Pushed commit about Viktor's review comments |
Pushed new commit to fix the URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Impressive patch. Copyrights may be set to 2025 (rather than 2024)
LGTM
(could you restart the (failing) tests in the PR before pushing)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't build the package without robdb, configure picks it up anyway:
checking for db.h... using lib/librobdb/lib/robdb.h
And then fails with
error: Installed (but unpackaged) file(s) found:
/usr/lib/debug/usr/lib64/dirsrv/librobdb.so-3.1.1.202501071235git0db4461d6-1.fc41.aarch64.debug
/usr/lib64/dirsrv/librobdb.so
RPM build errors:
Installed (but unpackaged) file(s) found:
/usr/lib/debug/usr/lib64/dirsrv/librobdb.so-3.1.1.202501071235git0db4461d6-1.fc41.aarch64.debug
/usr/lib64/dirsrv/librobdb.so
make: *** [rpm.mk:178: rpms] Error 1
I provided some suggestions to the spec file, but I need to test this more.
ifeq ($(BUNDLE_LIBDB), 1) | ||
BUNDLE_BDBREADERS ?= 0 | ||
else | ||
ifeq (,$(wildcard /usr/include/db.h#)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is #
a typo? With this I'm always getting robdb-libs package generated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed! I think that I added the # for some testing and forgot to remove it afterwards 😉
@@ -325,7 +332,7 @@ bin_PROGRAMS = dbscan \ | |||
# based on defines | |||
# ---------------------------------------------------------------------------------------- | |||
|
|||
server_LTLIBRARIES = libslapd.la libldaputil.la libns-dshttpd.la librewriters.la | |||
server_LTLIBRARIES = libslapd.la libldaputil.la libns-dshttpd.la librewriters.la librobdb.la |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be also behind a condition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed! I will fix it.
Co-authored-by: Viktor Ashirov <[email protected]>
This PR:
Issue: #6430
Reviewed by: @tbordaz and @vashirov (Thanks)