mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 14:10:49 -05:00
* feat(elasticache): support cluster-mode replication groups CreateReplicationGroup now provisions a real sharded Valkey cluster when the request asks for one (NumNodeGroups > 1, a cluster.on parameter group, or ClusterMode=enabled): one cluster-enabled container per node, formed via config epochs, MEET, slot assignment and replica attachment, each fronted by its own auth-proxy port announced to clients via cluster-announce-client-ipv4/cluster-announce-port so CLUSTER SLOTS and MOVED redirects point at reachable addresses. DescribeReplicationGroups reports the topology honestly (ClusterEnabled, NodeGroups with Slots, MemberClusters, Engine, ARN, AutomaticFailover), and replication-group members answer DescribeCacheClusters, which is where terraform-provider-aws reads node type, engine version and port from. Adds a terraform compatibility test that applies an aws_elasticache_replication_group with num_node_groups and replicas_per_node_group, asserts the data plane is a formed cluster running in cluster mode (INFO cluster / CLUSTER INFO over RESP through the proxy), and that a re-plan straight after apply is clean. * fix(elasticache): address cluster-mode review feedback and compat CI failure - bump compat-terraform aws-cli image to 2.34.32 so botocore models include ReplicationGroup.Engine (old pin silently dropped the field) - restore cluster-mode runtime state (ports, containers, proxies, cluster formation) after restart; mark groups create-failed on error - announce configured hostname to Valkey nodes so MOVED redirects and CLUSTER SLOTS return client-reachable endpoints - log swallowed socket-close failures in cluster formation * fix(elasticache): report restore-failed members and modeled node-group quota fault Review follow-up for cluster-mode support: - Member cache clusters mirror their group's status instead of a hardcoded "available", so a group marked create-failed by a failed restore no longer contradicts its own members in DescribeCacheClusters. CacheClusterStatus has no create-failed value, so failed members report the documented restore-failed. - NumNodeGroups above the 500 ceiling surfaces the modeled NodeGroupsPerReplicationGroupQuotaExceeded fault instead of a generic InvalidParameterValue. - Javadoc names ClusterMode=compatible handling and the cluster-mode-only restore scope as deliberate. * fix(elasticache): announce a client-resolvable hostname for cluster mode Cluster-mode nodes announced FLOCI_HOSTNAME verbatim, so the shipped Docker Compose deployment baked the Compose-only name 'floci' into MOVED/ASK redirects and topology responses, breaking cluster-aware clients connecting from outside the Compose network. Add FLOCI_SERVICES_ELASTICACHE_CLUSTER_ANNOUNCE_HOSTNAME (default: FLOCI_HOSTNAME) used for the announced name and the reported ConfigurationEndpoint, and set it to localhost.floci.io in docker-compose.yml — public DNS resolves it to 127.0.0.1 on the host while the network alias and Floci's embedded DNS resolve it to the Floci container from inside Docker. * fix(elasticache): restore cluster-mode groups without blocking startup Restoring persisted cluster-mode groups ran serially in the synchronous startup path, so a slow or unavailable Docker daemon could hold up emulator readiness by a container-readiness plus cluster-formation timeout per group, timing out readiness-dependent clients such as Testcontainers. restorePersistedRuntime now reserves each node's proxy port and marks groups creating synchronously - so no request can claim a persisted port or see a stale available status - then brings containers, cluster formation and proxies back in the background, flipping each group to available or create-failed as its restore finishes. --------- Co-authored-by: kurtmc <2661907+kurtmc@users.noreply.github.com>
40 lines
1.5 KiB
YAML
40 lines
1.5 KiB
YAML
services:
|
|
floci:
|
|
build:
|
|
context: .
|
|
dockerfile: docker/Dockerfile
|
|
tty: true
|
|
ports:
|
|
- "4566:4566"
|
|
- "6379-6399:6379-6399"
|
|
- "7001-7099:7001-7099"
|
|
- "9200-9299:9200-9299"
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
- ./data:/app/data
|
|
environment:
|
|
FLOCI_SERVICES_DOCKER_NETWORK: floci_default
|
|
FLOCI_SERVICES_RDS_PROXY_BASE_PORT: "7001"
|
|
# FLOCI_STORAGE_HOST_PERSISTENT_PATH is no longer needed.
|
|
# Floci now uses named Docker volumes by default.
|
|
# If you were using this env var for persistence, migrate: docker volume ls -f label=floci=true
|
|
FLOCI_HOSTNAME: floci
|
|
FLOCI_BASE_URL: http://floci:4566
|
|
# localhost.floci.io resolves everywhere: public DNS -> 127.0.0.1 on the host
|
|
# (reaching the published proxy ports), the network alias below inside Compose.
|
|
FLOCI_SERVICES_ELASTICACHE_CLUSTER_ANNOUNCE_HOSTNAME: localhost.floci.io
|
|
FLOCI_SERVICES_LAMBDA_HOT_RELOAD_ENABLED: "true"
|
|
# Match the compatibility workflow (.github/workflows/compatibility.yml) so the
|
|
# local Docker test run exercises the same Floci configuration as CI.
|
|
# TLS proxy serves HTTP and HTTPS on the same port 4566 (first-byte sniffing),
|
|
# so no extra port mapping is needed — this is what makes the TLS/HTTPS suites pass.
|
|
FLOCI_TLS_ENABLED: "true"
|
|
networks:
|
|
floci_default:
|
|
aliases:
|
|
- localhost.floci.io
|
|
|
|
networks:
|
|
floci_default:
|
|
name: floci_default
|