#51195 Ticket - 51189 integrate changelog in main database - update CLI
Closed by spichugi. Opened by tbordaz.
tbordaz/389-ds-base ticket_51189  into  master

Download 51195.patch

Bug description:
PHASE 2 of backend redesign:
http://www.port389.org/docs/389ds/design/integrate-changelog-database-and-backend-database.html
With https://pagure.io/389-ds-base/issue/49562, the changelog uses the main database.
Changelog configuration was managed with a global config entry (cn=changelog5,cn=config)
Now it is managed via a per backend config entry (cn=changelog,cn=).
Some config parameters are now in the backend specific changelog entry
nsslapd-changelogmaxage
nsslapd-changelogmaxentries
nsslapd-changelogtrim-interval
Some config paramters are simply abandonned (see design):
nsslapd-changelogdir
nsslapd-changelogcompactdb-interval

Fix description:
This fix (PR) is to be applied on top of 49562
It suppressed the ablity to create/delete changelog as the changelog entry
is now created/suppressed when a backend becomes a replica or not.

subcommands to set/get changelog attributes requires a suffix (aka backend).
dsconf <inst> replication set-changelog --suffix <suffix>  --trim-interval <val>
dsconf <inst> replication set-changelog --suffix <suffix>  --max-age <val>
dsconf <inst> replication set-changelog --suffix <suffix>  --max-entries <val>
dsconf <inst> replication get-changelog --suffix <suffix>
This patch removes the ability to restore a changelog (restore-changelog)
It implements a new 'class Changelog' to set/get the configuration attribute
of a per backend changelog

https://pagure.io/389-ds-base/issue/51189

Reviewed by: ?

These errors are printed to the user so it should be more user friendly specifying exactly what they did wrong.
Also, you've already set args.suffix as "required" so this check is not needed.

Maybe, we can name it set_db_cl or something like this? It is new now but it won't be later

The_l suffix here does mean lower already.

The same here, get_new_cl is confusing for both - CLI user and the one who will use Changelog() object in their scripts

Also, I, probably, miss the point here... It looks to me that be will always exist if we have some backend (even not related to the suffix).
You probably want to have something like this:

found_suffix = False
for be in be_insts:
    be_suffix = be.get_attr_val_utf8_l('nsslapd-suffix')
    if suffix == be_suffix:
        found_suffix = True
        break
if not found_suffix:
    raise ValueError()

rebased onto d9aa5801555984266d8905fad996c998efbbdc10

@spichugi thanks for your review. I updated the patch according to your remarks.

I've tried applying both #51181 and this one but dsconf localhost -v -D "cn=directory manager" -w password replication get-changelog --suffix dc=example,dc=com fails for me because of No such object error (it's not able to find cn=changelog,cn=userroot,cn=ldbmdatabase,cn=plugins,cn=config)

Can you suggest what can be wrong?

@spichugi sorry I missed your question. :(

Did you enabled replication (master or hub) before doing get-changelog ?
(like dsconf -D "cn=directory manager" -w password standalone1 replication enable --suffix "dc=example,dc=com" --role master --replica-id 1)

Right... I had an issue with the topology. Now I see it works.
Thanks! LGTM!

Thanks @spichugi for the review.
Need to push it on top of https://pagure.io/389-ds-base/pull-request/51181 and bump a new version. So waiting for the other review

indentation is off - causes flake8 errors. There are 5 spaces instead of 4 starting at "be_suffix = be.get_attr_val_utf8_l('nsslapd-suffix')"

associated is mispelled

This check needs to go :-)

And this one needs to go too

rebased onto 85291b6d3fe5162e94305d10bffa800035d2ada8

@mreynolds patch updated. Waiting for last IPA tests results

rebased onto b9ad60912941c33ded80c73e56c8a2096d7e22c3

rebased onto bf6e48666d8759a5365a54fd1b979457fe2b4d8b

IPA tests were successful. Pushing upstream that patch

Pull-Request has been merged by tbordaz

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This pull request has been cloned to Github as issue and is available here:
- https://github.com/389ds/389-ds-base/issues/4248

If you want to continue to work on the PR, please navigate to the github issue,
download the patch from the attachments and file a new pull request.

Thank you for understanding. We apologize for all inconvenience.

Pull-Request has been closed by spichugi

Metadata