gravitee-io / issues

Gravitee.io - API Platform - Issues
64 stars 26 forks source link

[repository] [http-bridge] Gateway does not resync (gateway-bridge-http) after network issue #4505

Closed twobeeb closed 3 years ago

twobeeb commented 3 years ago

We experienced a desync between the gateway and the database after a network issue on the gateway side. The gateways are not on the same network as the database and we are using gravitee-repository-gateway-bridge-http-server and gravitee-repository-gateway-bridge-http-client plugins.

Expected Behavior

When there's a network issue, gateway keep its latest configuration and continue to serve requests to the latest state it knows. When the network link comes back, it refresh its configuration.

Current Behavior

During the network downtime, the gateway properly served API that were deployed before the network issue (GOOD) When the network link came back, it nevers synced with the database and did not serve new API, that were deployed during/after the network issue (KO) We have 2 gateway in that scenario and only one gateway had a sync issue.

After restarting the desynced gateway, everything came back to normal.

Steps to Reproduce (for bugs)

I don't have the steps. There have been multiple occurence of network slowness/link issue and most of the time, the gateways managed to resync without problem. During the same period, out of 2 gateways (with exactly the same config), only one did have this issue.

Context

We are currently implementing the following architecture: Central network : Postgres + REST API + Elastic + Portal UI + Mgt UI + Gateway http bridge server

Local network : Load balancer + 2 gateways (with http-bridge-client) Local network should be able to live without link/access to central network for extended period of time.

Your Environment

export GRAVITEE_VERSION=3.0.7 export GRAVITEE_REPOSITORY_JDBC_VERSION=3.0.4 export GRAVITEE_REPOSITORY_GATEWAY_BRIDGE_VERSION=3.0.3 docker images for the gateway

version: '3.5'
services:
  gateway:
    image: docker.artifactory/f4m/graviteeio/apim-gateway:3.0.7 # rebuild to package necessary libs
    container_name: gio_apim_gateway
    restart: always
    ports:
      - "8082:8082"
    hostname: "gateway01"
    volumes:
      - ./logs:/opt/graviteeio-gateway/logs
    environment:
      - GRAVITEE_PLUGINS_PATH_0=$${gravitee.home}/plugins
      - GRAVITEE_RATELIMIT_TYPE=redis
      - GRAVITEE_RATELIMIT_REDIS_HOST=local-network-ip
      - GRAVITEE_RATELIMIT_REDIS_PORT=6379
      - GRAVITEE_RATELIMIT_REDIS_PASSWORD=***
      - GRAVITEE_MANAGEMENT_TYPE=http
      - GRAVITEE_MANAGEMENT_HTTP_URL=https://central-network-ip/gateway-bridge/
      - GRAVITEE_MANAGEMENT_HTTP_AUTHENTICATION_BASIC_USERNAME=***
      - GRAVITEE_MANAGEMENT_HTTP_AUTHENTICATION_BASIC_PASSWORD=***
      - gravitee_reporters_elasticsearch_endpoints_0=http://central-network-ip:8443
      - gravitee_reporters_elasticsearch_security_username=***
      - gravitee_reporters_elasticsearch_security_password=***
brasseld commented 3 years ago

Fixed by https://github.com/gravitee-io/issues/issues/4505

tcompiegne commented 3 years ago

Fixed by #4513