Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix saving workspace services not working with pgconfig #565

Conversation

groldan
Copy link
Member

@groldan groldan commented Oct 26, 2024

Saving the workspace services not working with pgconfig when caching is enabled. CachingGeoServerFacade assumed there's nothing to do when a ServiceInfo is added for a workspace, but it was caching the null value, which is expected to save db roundtrips.

  • Add missing treatment of ServiceInfoAdded and SettingInfoAdded to CachingGeoServerFacade.

  • Add referential integrity for settingsinfo and serviceinfo

Now the flyway migration will add referential integrity for:

  • settingsinfo(workspace) -> workspaceindo(id)
  • serviceinfo(workspace) -> workspaceinfo(id)

And unique indexes for:

  • settingsinfo(workspace)
  • serviceinfo("@type", workspace)

As a side effect of the caching facade returning null once a ServiceInfo as added, you could add multiple services of the same kind for a workspace. The referential integrity checks will avoid that, and the FlyWay migration will delete existing duplicates.


Fixes #560

Saving the workspace services not working with pgconfig when
caching is enabled. `CachingGeoServerFacade` assumed there's
nothing to do when a `ServiceInfo` is added for a workspace,
but it was caching the `null` value, which is expected to save
db roundtrips.

- Add missing treatment of `ServiceInfoAdded` and `SettingInfoAdded`
to `CachingGeoServerFacade`.

- Add referential integrity for settingsinfo and serviceinfo

Now the flyway migration will add referential integrity for:

 - `settingsinfo(workspace) -> workspaceindo(id)`
 - `serviceinfo(workspace) -> workspaceinfo(id)`

And unique indexes for:

- `settingsinfo(workspace)`
- `serviceinfo("@type", workspace)`

As a side effect of the caching facade returning null once a
`ServiceInfo` as added, you could add multiple services of the
same kind for a workspace. The referential integrity checks will
avoid that, and the FlyWay migration will delete existing duplicates.
@groldan groldan added the bugfix Pull request to fix a bug label Oct 26, 2024
@groldan groldan self-assigned this Oct 26, 2024
@groldan groldan merged commit 14d83d1 into geoserver:main Oct 26, 2024
4 checks passed
@groldan groldan deleted the bug/caching_add_service_and_settings_wont_clear_cache branch October 26, 2024 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Pull request to fix a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Edit Workspce Service invalid
1 participant