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

Implement eventual consistency enforcement for the datadir catalog backend #484

Merged
merged 1 commit into from
Jun 14, 2024

Conversation

groldan
Copy link
Member

@groldan groldan commented Jun 14, 2024

When performing several catalog updates, for example through the REST API, and especially if the rabbitmq event bus is under stress, catalog events may arrive out of order.

This is troublesome for the datadir catalog backend, as the add/modify event for a given CatalogInfo may arrive before the event for one of its dependencies. For example, the WorkspaceInfo for a StoreInfo does not yet exist in the local catalog.

The EventuallyConsistentCatalogFacade will delay such changes with missing dependencies until they're resolved. This is usually a matter of a few milliseconds.

Also, when a web request is in progress, and an object is not found, the catalog facade will retry the operation for a configurable number of times and milliseconds, giving the eventual consistency enforcer a chance to having resolved a pending update.

The default configuration properties are as follow:

geoserver:
  backend:
    data-directory:
      eventual-consistency:
        # eventual consistency enfocement. Bus events may come out of order under stress
        enabled: true
        # milliseconds to wait before retries. The list size determines the number of retries. The values the milliseconds to wait
        retries: 25, 25, 50

@groldan groldan added the enhancement New feature or request label Jun 14, 2024
@groldan groldan force-pushed the GSBAB-151 branch 3 times, most recently from 87abff7 to ab7434d Compare June 14, 2024 12:46
…ckend

When performing several catalog updates, for example through the REST
API, and especially if the rabbitmq event bus is under stress, catalog
events may arrive out of order.

This is troublesome for the datadir catalog backend, as the add/modify
event for a given CatalogInfo may arrive before the event for one of
its dependencies. For example, the WorkspaceInfo for a StoreInfo does
not yet exist in the local catalog.

The `EventuallyConsistentCatalogFacade` will delay such changes with
missing dependencies until they're resolved. This is usually a matter of
a few milliseconds.

Also, when a web request is in progress, and an object is not found, the
catalog facade will retry the operation for a configurable number of
times and milliseconds, giving the eventual consistency enforcer a
chance to having resolved a pending update.

The default configuration properties are as follow:

```
geoserver:
  backend:
    data-directory:
      eventual-consistency:
        # eventual consistency enfocement. Bus events may come out of order under stress
        enabled: true
        # milliseconds to wait before retries. The list size determines the number of retries. The values the milliseconds to wait
        retries: 25, 25, 50
```
@groldan groldan merged commit da6219e into geoserver:main Jun 14, 2024
2 checks passed
@groldan groldan deleted the GSBAB-151 branch June 14, 2024 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant