#49506 scope base search with tombstone yields empty result
Opened 2 years ago by firstyear. Modified 3 months ago

Issue Description

Search scope base with a dn of tombstone (from mod_delete) yields no results. The same search with scope subtree operates correctly.

# WORKS
ldapsearch -H ldap://localhost:39001 -D 'cn=Directory Manager' -w password -s sub -b 'nsuniqueid=c04c0107-e4a611e7-b5dae1e9-cbd6b25a,uid=testuser,ou=People,dc=example,dc=com' '(objectclass=nsTombStone)' \* +
# FAILS
ldapsearch -H ldap://localhost:39001 -D 'cn=Directory Manager' -w password -s base -b 'nsuniqueid=c04c0107-e4a611e7-b5dae1e9-cbd6b25a,uid=testuser,ou=People,dc=example,dc=com' '(objectclass=nsTombStone)' \* +

in base_candidates we call find_entry with flags of 0 (missing TOMBSTONE_INCLUDED). However, setting this to TOMBSTONE_INCLUDED did no correct the behaviour (and may cause other issues).

@lkrispen indicated this may be related to the entryrdn index, however a proper investigation is required to the cause and fix.


this is a effect of the specific tombstone dn format chose, where a tombstone technically has 2 rdns and always requires a specila handling.
The optimal fix would be to implement #49507 and get rid of special handling.

I did investigate a bit where base searches and modify ops go wrong and have a fix working for these issues, but it looks as if there could be more cleanup (even with the special rdn), and I have not run wide regression tests.
I'll attach the patch as it is now for comments

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

2 years ago

Thanks for the patch for this!

Would you mind explaining to me what the three sections do and why it fixes them as I'm curious about the root cause and the fix?

Otherwise the code looks good, very simple change. I have not yet applied and tested it though, I'll do that shortly.

I can confirm this fixes my issue that I was having. I'm expanding the replication tombstone test case to exercise this patch as well.

The patch looks good and tests are successful.
Just a question regarding slapi_is_special_rdn. Now it returns 1 only if the tombstone rdn is not the RUV. I have not found this function in the external doc does this mean it is purely DS core stuff.
Also the flag is_tombstone in no more used in _slapi_rdn_init_all_dn_ext, so it could be removed from the callers

Ahh yes, good spot @tbordaz, it would be good to remove another special case flag.

@lkrispen I know you are busy with other patches right now, but I want to say that I have been testing this for a while with replication test suite and some extra cases, and can confirm it works. :) Would be great to have this finished once you are finished your other pressing tasks mate,

@lkrispen Can you merge this? A few weeks of testing from me and I think it looks good.

Metadata Update from @firstyear:
- Custom field reviewstatus adjusted to ack (was: None)

2 years ago

Metadata Update from @mreynolds:
- Issue set to the milestone: 1.3.7.0

2 years ago

Metadata Update from @mreynolds:
- Issue set to the milestone: 1.4.2 (was: 1.3.7.0)

3 months ago

@lkrispen - is this still applicable?

need to check

Login to comment on this ticket.

Metadata
Attachments 1