#46 Issue 45 - RFE - Allow to rebuild the compat tree
Merged by abbra. Opened by tbordaz.
tbordaz/slapi-nis ticket_45  into  master

Download 46.patch

Description:
For different reasons, the compat tree maps might get corrupted and some entries would be missing.
This RFE provides a way to rebuild online the whole compat tree on demand via a DS task.

Fix:
It registers tasks callbacks under cn=chema compatibility
refresh task,cn=tasks,cn=config. The task meta data contains
the filter (SCH_CONTAINER_CONFIGURATION_FILTER) and the
plugin_state (not retrievable via pblock).
The rebuild task (backend_shr_refresh_thread) is shared
as it can be used by NIS or Schema Compat.
The rebuild task disable access to the maps, free and
reinit them. Then rebuild them using the already implemented
backend_shr_data_initialize_thread.

Review:

Why here now we have static while in src/back-sch.c we don't have static? Both plugins link against the same src/back-shr.c which calls backend_entry_get_set_config_entry_filter(). If you'd do it static here, that call linkage would be broken.

space/tab mix compared to the next line?

Hi @tbordaz, thank you for the PR. I have left few comments inline.

rebased onto 91992210ed5b9abb291962008afc957d0fb30dc5

Thanks @abbra for the review. I have updated the files for spaces/tab and also for the nis function backend_entry_get_set_config_entry_filter that should not be static

@tbordaz thank you for the changes. I have only one question left -- in the task allocation functions for both nis and slapi plugins we don't do checks for strdup failures. Should we?

rebased onto d966e476e0c2e9c6c59e6fc95a9090a473c97771

Failure of strdup (aka slapi_ch_strdup) should not really happen. Else meaning that all virtual space has been consumed and then we can anticipate many others failures.
Checking the duplicate strings are not NULL is good, to prevent a task running with dummy args. I updated the patch. Thanks

Pull-Request has been merged by abbra

Merged, thanks. However, I had to fix few issues:

  • use of 389-ds' private function int slapi_td_set_dn(char *dn);, I had to define it with extern modifier in slapi-nis code;
  • backend_entry_get_set_config_entry_filter helper implementation had inconsistent signature and was not declared in back-shr.h as it should. I had to fix that.
Metadata