geoserver / geoserver-cloud

Cloud Native GeoServer is GeoServer ready to use in the cloud through dockerized microservices.
http://geoserver.org/geoserver-cloud
Other
244 stars 73 forks source link

[Backport 1.8.x] Implement eventual consistency enforcement for the datadir catalog backend #485

Closed groldan closed 2 months ago

groldan commented 2 months ago

Backport #484 to release/1.8.x

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