#49461 Improve db2index handling with python 3
Closed: wontfix 7 years ago Opened 7 years ago by firstyear.

Issue Description

db2index requires an attribute to be provided, else it will not run. Improve the support to work with python3 and missing perl.


Metadata Update from @firstyear:
- Custom field component adjusted to None
- Custom field origin adjusted to None
- Custom field reviewstatus adjusted to review
- Custom field type adjusted to None
- Custom field version adjusted to None

7 years ago

Metadata Update from @spichugi:
- Custom field reviewstatus adjusted to ack (was: review)

7 years ago

well if you don't supply attrs to index then db2index is supposed to reindex all attributes. That's how the current tool works so lib389 should allow "no attributes"

What's the call to ns-slapd that indexes all attributes? I couldn't make it work ....

Hmm I get usage errors, but it says in the usage that its supposed to index all attributes. And I recall adding that feature, so I think we have a bug in the script itself

    echo "Usage: db2index [-Z serverID] [-n backend | {-s includesuffix}* -t attribute[:indextypes[:matchingrules]]"
    echo "                -T vlvTag] [-v] [-h]"
    echo "Options:"
    echo "        -Z serverID       - Server instance identifier"
    echo "        -n backend        - Backend database name.  Example: userRoot"
    echo "        -s includeSuffix  - The suffix to index"
    echo "        -t attribute[:indextypes[:matchingrules]]"
    echo "                          - attributeName: name of the attribute to be indexed";
    echo "                            If omitted, all the indexes defined for that instance are generated."
    echo "                          - indextypes: comma separated index types"
    echo "                          - matchingrules: comma separated matrules"
    echo "                                 Example: -t foo:eq,pres"
    echo "        -T vlvTag         - VLV index name"
    echo "        -v                - Display version"
    echo "        -h                - Display usage"

Yeah its a bug in the script's usage check. If I add "-Z" it works and I can see all indexes getting indexed:

db2index -Z localhost -n userroot

Yes, but ns-slapd requires -t as well. What's the ns-slapd command?

ns-slapd db2index -D /etc.... -n userRoot

does not work :(

Check the db2index script ;-)

Actually the script calls this for complete reindex:

bak_dir=/var/lib/dirsrv/slapd-$servid/bak/reindex_`date +%Y_%m_%d_%H_%M_%S`
/usr/sbin/ns-slapd upgradedb -D $CONFIG_DIR -a "$bak_dir"

So it basically does a reimport - not a reindex of each attr, db2index.pl actually reindexes each attribute. So they behave differently to get the desired results.

I did check the script, it made no sense.

Whaaaaaaa upgradedb? Whaaaaaa????????

I did check the script, it made no sense.
Whaaaaaaa upgradedb? Whaaaaaa????????

Yeah, crazy, but it works. The whole process should be redone some day, because "upgradedb" also makes unexpected backups.

commit 8a7bee6
To ssh://git@pagure.io/389-ds-base.git
938dfb7..8a7bee6 master -> master

Metadata Update from @firstyear:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

7 years ago

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 issue has been cloned to Github and is available here:
- https://github.com/389ds/389-ds-base/issues/2520

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Metadata Update from @spichugi:
- Issue close_status updated to: wontfix (was: fixed)

4 years ago

Log in to comment on this ticket.

Metadata