Skip to content

Commit

Permalink
Update test for CA clone with replicated DS
Browse files Browse the repository at this point in the history
The test for CA clone with replicated DS has been updated
to create search and VLV indexes manually since it will call
pkispawn with pki_ds_setup=False which will skip those steps.
  • Loading branch information
edewata committed Dec 14, 2023
1 parent fd79ec5 commit e90523a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/ca-clone-replicated-ds-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,16 @@ jobs:
diff primaryds.dn secondaryds.dn
- name: Create search indexes
run: |
docker exec secondary pki-server ca-db-index-add -v
docker exec secondary pki-server ca-db-index-rebuild -v
- name: Create VLV indexes
run: |
docker exec secondary pki-server ca-db-vlv-add -v
docker exec secondary pki-server ca-db-vlv-reindex -v
# https://github.com/dogtagpki/pki/wiki/Installing-CA-Clone-with-Existing-DS
- name: Install secondary CA
run: |
Expand Down
18 changes: 9 additions & 9 deletions base/server/python/pki/server/deployment/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1557,15 +1557,6 @@ def setup_database(self, subsystem, master_config):
skip_base=skip_base,
skip_containers=skip_containers)

# always create indexes
subsystem.add_indexes()

# if the database is already replicated but not yet indexed, rebuild the indexes
if config.str2bool(self.mdict['pki_clone']) and \
not config.str2bool(self.mdict['pki_clone_setup_replication']) and \
config.str2bool(self.mdict['pki_clone_reindex_data']):
subsystem.rebuild_indexes()

if config.str2bool(self.mdict['pki_clone']) and \
config.str2bool(self.mdict['pki_clone_setup_replication']):
self.setup_replication(subsystem, master_config)
Expand All @@ -1586,6 +1577,15 @@ def setup_database(self, subsystem, master_config):

subsystem.grant_database_access(dbuser)

# Always create search and VLV indexes since they will not be replicated
subsystem.add_indexes()

# If the database is already replicated but not yet indexed, rebuild the indexes
if config.str2bool(self.mdict['pki_clone']) and \
not config.str2bool(self.mdict['pki_clone_setup_replication']) and \
config.str2bool(self.mdict['pki_clone_reindex_data']):
subsystem.rebuild_indexes()

subsystem.add_vlv()
subsystem.reindex_vlv()

Expand Down

0 comments on commit e90523a

Please sign in to comment.