Compare commits

..
423 Commits
Author SHA1 Message Date
Рябов Владислав Олегович f7a141d25e Merge branch 'MSP-9033' into 'main'
MSP-9033 update deps

Closes MSP-9033

See merge request isp/isp-config-service!24
2026-11-20 10:43:21 +00:00
riabovvo 6731fc6b93 MSP-9033 update deps 2026-11-20 13:42:09 +03:00
Рябов Владислав Олегович d45f814d6a Merge branch 'MSP-9033' into 'main'
update deps

Closes MSP-9033

See merge request isp/isp-config-service!23
2026-11-20 09:15:19 +00:00
riabovvo 1ff499ace3 update deps 2026-11-20 12:12:39 +03:00
Рябов Владислав Олегович b481c2a45e Merge branch 'MSP-9033' into 'main'
Resolve MSP-9033

Closes MSP-9033

See merge request isp/isp-config-service!22
2026-11-20 07:46:26 +00:00
riabovvo dde6c49b92 MSP-9033 update Dockerfile 2026-11-20 10:26:44 +03:00
riabovvo 9a66bd060a MSP-9033 bump version to 3.12.1 2026-11-20 10:11:31 +03:00
riabovvo d669c65038 MSP-9033 update local.go 2026-11-20 10:11:17 +03:00
komissarovyv c9ee296835 Merge branch 'module-leader-election' into 'main'
Module leader election: derivation, event narrowing and observation API

See merge request isp/isp-config-service!21
2026-11-19 13:21:17 +03:00
komissarovyv 53dff62759 Update release notes for the leader logging change 2026-11-19 12:57:41 +03:00
komissarovyv 439e6f5ebf Drop the module leader recompute event
The queue event did two things: set the routing-changed flag, which the lifecycle
event of the same change already sets, and deliver the leader-change info log. It
cost an extra raft INSERT per connect/disconnect, two GetForLeaderElection reads per
lifecycle event used for nothing else, a payload kind, a compaction key and a
subscription-service method that only logged.

The leader is now logged where it is published: the address-list emission logs the
leader it just sent, and the routing rebuild logs one summary line with the leaders
it published. Modules without election stay silent, as before.

A future self-election needs a recompute trigger that also re-broadcasts the address
list; that event will be added when the requirement exists, not carried as a no-op.
2026-11-19 12:57:28 +03:00
komissarovyv a8a475435c Bump version to 3.12.0 2026-11-19 12:14:34 +03:00
komissarovyv b36cb1cd0e Update kit to 1.76.0 2026-11-19 12:13:00 +03:00
komissarovyv 06ec2c6a87 Fix flaky leader flag assertion in module leader mode test 2026-11-18 22:05:09 +03:00
komissarovyv 45d7ea443f Show module leader flag in the observation API 2026-11-18 21:59:30 +03:00
komissarovyv 2bb06ffb8e Share module leader derivation by module 2026-11-18 21:49:35 +03:00
komissarovyv 45de1d1b12 Log module leader changes on the recompute event
The event handler maps the leader recompute onto the routing map rebuild with
the ready and disconnected events of the batch, so a leader change reaches the
routing map of every config service node.

The address list is not re-broadcast from it: the ready and disconnected event
of the same change already broadcasts it, and an extra snapshot per connect
broke the acceptance test on the exact number of host lists a module receives.

An info is written when the leader address in the payload differs from the
address before the change, naming the module, both addresses and the reason.
An event that changed nothing is silent, so the log stays readable.
2026-11-18 21:29:29 +03:00
komissarovyv 6cd0b2c712 Add internal module leader recompute event
The queue gets a payload kind of its own to recompute a module leader, with the
compaction key module_leader_<moduleId> so the collapse of ready and
disconnected into one module_lifecycle_<moduleId> event cannot swallow it.

The event is inserted next to the events of the same change: on a connect, on a
disconnect by WebSocket close, and on the phantom cleanup of the own node.
Graceful shutdown by DeleteOwnBackends keeps inserting no events. The payload
carries the leader address before and after the change, derived from the module
instances that are already loaded, so the event worker reads nothing from the
database. No new columns, no new tables, no new migrations.
2026-11-18 21:29:23 +03:00
komissarovyv 3d04dd2df7 Narrow module events to the module leader 2026-11-18 20:00:09 +03:00
komissarovyv 6cfa1955ea Derive module leader from connected instances 2026-11-18 20:00:09 +03:00
komissarovyv 9e24122e75 Cover module leader mode storage in acceptance tests 2026-11-18 19:31:14 +03:00
komissarovyv 71997dc438 Expose rqlite db handle for tests 2026-11-18 19:31:14 +03:00
komissarovyv bd8a1b2de4 Add module_leader_mode column to connected instances 2026-11-18 19:31:10 +03:00
komissarovyv 7b0108a358 Pin leader contract fields in the acceptance harness 2026-11-18 19:12:53 +03:00
komissarovyv a195c76799 Local isp-kit replace for module leader contract 2026-11-18 19:06:10 +03:00
komissarovyv 780c2232fb Merge branch 'fix-variable-links-persist' into 'main'
Fix: variable links not saved when a variable is used multiple times in config

See merge request isp/isp-config-service!20
2026-10-28 11:37:27 +03:00
Hermes Agent ef0978e064 Bump version to 3.11.1, add changelog 2026-10-28 11:29:32 +03:00
Hermes Agent c464393e93 Drop link self-healing paths, fix linter findings
- Remove link resync on module reconnect, link resave on no-op config
  update, and link backfill on variable create/upsert: links are
  formed only on config save
- Disable exhaustruct_v5 and goconst linters
- Fix golangci-lint findings: noinlineerr, slices.Backward,
  wrapcheck for ConfigValidationError (errors.As in controller keeps
  working via %w), funlen nolint on acceptance test
2026-10-28 11:22:59 +03:00
Hermes Agent 7f4e3ef028 Fix variable links not persisted when variable is used multiple times in config
- Dedupe extracted variable names (duplicate INSERTs aborted the
  config_has_variable transaction on PK conflict)
- Check per-statement rqlite errors in ExecTransaction: a failed
  statement silently returned success before
- Make link upserts idempotent (insert or ignore) and add link
  backfill on variable create/upsert from existing configs
- Validate config variables before insert (no orphaned configs)
- Resync active config links on module reconnect and on no-op
  config update (self-healing)
2026-10-28 10:34:45 +03:00
Синельник Тимур Романович 5c8a554d4f Merge branch 'MSP-8394' into 'main'
Resolve MSP-8394

Closes MSP-8394

See merge request isp/isp-config-service!19
2026-09-25 14:11:50 +03:00
Синельник Тимур Романович 5bdb4813b5 MSP-8394 Guard returning errors.WithMessage with err != nil check 2026-09-25 14:08:18 +03:00
Синельник Тимур Романович 17ec4bdce9 MSP-8394 Use slices.Backward for cycle 2026-09-25 14:06:15 +03:00
Синельник Тимур Романович 428de36857 MSP-8394 Up deps & use isp-kit/errors 2026-09-25 13:45:02 +03:00
Синельник Тимур Романович fc9c4f956f MSP-8394 Bump version to 3.11.0 2026-08-24 12:23:43 +03:00
Синельник Тимур Романович 44961d8416 MSP-8394 Add required admin permission 2026-08-24 12:22:33 +03:00
komissarovyv 2a846c67e4 MODULE_READY can be handled several times 2026-08-09 12:45:52 +03:00
komissarovyv 481f06bfec Bump dependencies 2026-07-27 16:21:37 +03:00
komissarovyv 3b99380a62 Disable migrate tool build 2026-07-07 12:41:50 +03:00
komissarovyv ffa09db7b2 Merge branch 'MSP-8007' into 'main'
Resolve MSP-8007

Closes MSP-8007

See merge request isp/isp-config-service!18
2026-07-07 11:44:22 +03:00
kochanovrv 94af308030 MSP-8007 fix threads 2026-07-07 11:24:09 +03:00
kochanovrv 36e320af28 MSP-8007 up sqlite 2026-07-06 16:21:06 +03:00
kochanovrv c2d7aea679 MSP-8007 up version to v3.9.2 2026-07-06 15:02:33 +03:00
kochanovrv aebd33e5cb MSP-8007 update isp-kit 2026-07-06 15:02:15 +03:00
Кузьмин Игорь Александрович 45b28e46e6 Edit .gitlab-ci.yml 2026-05-13 11:23:17 +00:00
Грязнов Денис Владимирович 48ccd130b2 Merge branch 'MSP-7572' into 'main'
Resolve MSP-7572

Closes MSP-7572

See merge request isp/isp-config-service!17
2026-04-23 14:17:35 +00:00
nglmq 7eb341856d MSP-7572 edit endpoint to inner 2026-04-22 12:36:48 +03:00
nglmq 38fe10f3a1 MSP-7572 bump version to 3.9.1 2026-04-22 12:36:48 +03:00
nglmq fa327ecf5c MSP-7572 edit go version in Dockerfiles 2026-04-22 12:36:48 +03:00
nglmq 6c3e8a632e MSP-7572 linter fixes 2026-04-21 12:35:50 +03:00
nglmq 03fcb26473 MSP-7572 swagger update 2026-04-21 11:57:23 +03:00
nglmq 7f4a1c8131 MSP-7572 new andpoint for required modules 2026-04-21 11:57:00 +03:00
komissarovyv 416f9307c3 Bump isp-kit 2026-02-20 19:26:48 +03:00
Грязнов Денис Владимирович 1273869b07 Merge branch 'dev' into 'main'
Dev

See merge request isp/isp-config-service!16
2026-02-11 13:45:59 +00:00
Синельник Тимур Романович 1839a18bb4 up deps 2026-02-11 16:14:03 +03:00
Синельник Тимур Романович 34d7fabf61 MSP-7042 Bump version to 3.9.0 2026-02-11 16:13:27 +03:00
Синельник Тимур Романович c295bda53b MSP-7042 Up deps & support http methods and transport 2026-02-11 16:13:03 +03:00
komissarovyv f97795bd90 Fix migrate 2026-02-10 17:35:55 +03:00
Кузьмин Игорь Александрович f7931b1d83 Edit .gitlab-ci.yml 2026-02-09 09:06:25 +00:00
Кузьмин Игорь Александрович 245cf8852d Edit .gitlab-ci.yml 2026-02-06 08:11:25 +00:00
Кузьмин Игорь Александрович 7b09eb3a07 Edit Dockerfile.dit 2026-02-05 14:45:18 +00:00
Кузьмин Игорь Александрович e45900fbaa Revert "Replace .gitlab-ci.yml"
This reverts commit aefc14ece9
2026-02-05 14:41:25 +00:00
Кузьмин Игорь Александрович b0330e80f3 Revert "Delete Dockerfile.dit"
This reverts commit 5a3d4fffea
2026-02-05 14:38:46 +00:00
Синельник Тимур Романович 9a2cdd0662 Merge branch 'sprint_dev' into 'main'
Sprint dev

Closes MSP-6930

See merge request isp/isp-config-service!13
2026-01-26 15:48:59 +03:00
Синельник Тимур Романович 9b577e96b1 Merge branch 'MSP-6930' into 'sprint_dev'
Resolve MSP-6930

See merge request isp/isp-config-service!14
2025-12-18 13:33:21 +03:00
Синельник Тимур Романович 7873c57c8e MSP-6930 Bump version to 3.8.0 2025-12-18 12:21:17 +03:00
Синельник Тимур Романович 38fdb65ec2 MSP-6930 Update updated_at 2025-12-18 12:21:17 +03:00
Синельник Тимур Романович 9ebf03a15a MSP-6930 Add /schema/update_by_module_name endpoint 2025-12-18 12:12:22 +03:00
Лихачев Алексей Михайлович 8101f9a8c8 Merge branch 'MSP-6703' into 'main'
MSP-6703

See merge request isp/isp-config-service!12
2025-12-01 13:37:18 +00:00
likhachevam 924d1cf6fe MSP-6703 up version to v3.7.0 2025-12-01 12:34:15 +03:00
likhachevam de3e456617 MSP-6703 fix 'enabled' config field 2025-12-01 12:34:05 +03:00
likhachevam fc5a21d6bb MSP-6703 add AutoOptimizeInterval to config.yml 2025-11-24 15:21:15 +03:00
likhachevam 4763d88628 MSP-6703 remove unused utils 2025-11-21 16:10:27 +03:00
likhachevam a6d72ec1a4 MSP-6703 add rqlite backup proxy 2025-11-21 16:03:57 +03:00
likhachevam 99d4aaca45 MSP-6703 fix race conditions 2025-11-21 13:24:48 +03:00
likhachevam 2f614a5c75 MSP-6703 update clearInterval format 2025-11-21 13:24:32 +03:00
likhachevam 960b87d86d MSP-6703 update waitForLeaderTimeout 2025-11-20 18:37:44 +03:00
likhachevam 35e15b7ae1 MSP-6703 update config.yml 2025-11-20 15:23:25 +03:00
likhachevam 392e5f5cff MSP-6703 fix go version 2025-11-20 14:58:18 +03:00
likhachevam 451d277644 MSP-6703 add backup_cleaner 2025-11-20 11:04:25 +03:00
likhachevam 2caed6b3f0 MSP-6703 up rqlite & add backups 2025-11-20 11:04:02 +03:00
likhachevam a349df7b05 MSP-6703 up dependencies 2025-11-20 11:01:43 +03:00
Лихачев Алексей Михайлович efed09bb92 Merge branch 'MSP-6459' into 'main'
MSP-6459

See merge request isp/isp-config-service!11
2025-10-09 12:25:11 +00:00
likhachevam a2c222dfd9 MSP-6459 up version to v3.6.0 2025-10-08 11:31:16 +03:00
likhachevam 129ce7c2c6 MSP-6459 update /purge_versions endpoint 2025-10-08 11:31:11 +03:00
likhachevam cde261cf5d MSP-6459 up go version to v1.25 2025-10-07 17:49:10 +03:00
likhachevam 8ef12f8b11 MSP-6459 update /purge_version endpoint 2025-10-07 17:27:58 +03:00
likhachevam 99782ef3bb MSP-6459 update linter 2025-10-07 16:46:34 +03:00
likhachevam 6a36603b5d MSP-6459 add PurgeConfigVersions endpoint 2025-10-07 16:46:18 +03:00
Кузьмин Игорь Александрович 5a3d4fffea Delete Dockerfile.dit 2025-09-17 14:41:30 +00:00
Грязнов Денис Владимирович 7a585711f6 Merge branch 'MSP-6078' into 'main'
Resolve MSP-6078

Closes MSP-6078

See merge request isp/isp-config-service!10
2025-08-21 12:03:53 +00:00
Кузнецов Иван Александрович d024e038c2 MSP-6078 update deps 2025-08-21 14:20:59 +03:00
Кузнецов Иван Александрович 7b329a8c73 MSP-6078 update deps 2025-08-21 13:45:43 +03:00
Кузнецов Иван Александрович e62089f019 MSP-6078 bump version to 3.5.0 2025-08-20 14:09:46 +03:00
Кузнецов Иван Александрович c3ed4a0e27 MSP-6078 update deps 2025-08-20 14:06:40 +03:00
komissarovyv 846129b1af Bump dependencies 2025-07-08 11:30:51 +03:00
komissarovyv 66edb03aa4 Bump dependencies 2025-07-08 11:20:46 +03:00
komissarovyv d56d6613bb Call upsert variables in any case 2025-07-08 11:19:04 +03:00
Кузьмин Игорь Александрович 5a67d0cc4f Edit README.md 2025-06-23 08:56:31 +00:00
Кузьмин Игорь Александрович 803b067278 Edit README.md 2025-06-23 07:58:36 +00:00
Рябов Кирилл Александрович 78eeee0bc6 Merge branch 'MSP-5579' into 'main'
MSP-5579

See merge request isp/isp-config-service!9
2025-06-10 13:09:48 +07:00
Kirill Ryabov c6f2c3a813 MSP-5579 bump version to 3.4.0 2025-06-09 16:10:30 +03:00
Kirill Ryabov 441702a180 MSP-5579 update swagger 2025-06-09 16:10:30 +03:00
Kirill Ryabov de85ffa726 MSP-5579 add test for autodiscovery functionality 2025-06-09 16:10:30 +03:00
Kirill Ryabov 1482636ad8 MSP-5579 enable metrics autodiscovery 2025-06-09 16:10:30 +03:00
Kirill Ryabov b62b0eef8b MSP-5579 include internal metrics autodiscovery method to locator & setup route 2025-06-09 16:10:30 +03:00
Kirill Ryabov 37f85f56fa MSP-5579 implement internal metrics autodiscovery endpoint 2025-06-09 16:10:30 +03:00
Kirill Ryabov 4c131093b1 MSP-5579 add handling MetricsAutodiscovery field from backend declaration 2025-06-09 14:52:49 +03:00
Kirill Ryabov 22bfe6f2a1 MSP-5579 enrich Backend struct with MetricsAutodiscovery field & add MetricsAdWrapper struct 2025-06-09 14:52:49 +03:00
Kirill Ryabov fd5ce55c4c MSP-5579 add metrics_autodiscovery column migration 2025-06-09 11:35:23 +03:00
Kirill Ryabov e5494e2849 MSP-5579 update dependencies 2025-06-09 11:35:23 +03:00
Кузьмин Игорь Александрович eb79974760 Edit Dockerfile 2025-06-06 14:02:13 +00:00
Кузьмин Игорь Александрович 350d22ae75 Edit Dockerfile 2025-06-06 13:49:02 +00:00
Рябов Кирилл Александрович 3e7f235876 Merge branch 'MSP-5494' into 'main'
MSP-5494

See merge request isp/isp-config-service!8
2025-05-27 18:36:55 +07:00
Kirill Ryabov 778e194d1d MSP-5494 bump version to 3.3.1 2025-05-26 14:43:31 +03:00
Kirill Ryabov bfe9764707 MSP-5494 update swagger 2025-05-26 14:43:31 +03:00
Kirill Ryabov 5877176645 MSP-5494 update dependencies 2025-05-26 14:43:31 +03:00
Kirill Ryabov 10e74db016 MSP-5494 migrate linter to v2 2025-05-26 14:43:31 +03:00
Kirill Ryabov 82f6d624ba MSP-5494 add github actions ci to build & publish docker image 2025-05-26 14:43:31 +03:00
Кузьмин Игорь Александрович 22e76538c4 Edit README.md 2025-04-18 13:57:57 +00:00
Кузьмин Игорь Александрович 11a5477bcb Edit README.md 2025-04-18 09:40:32 +00:00
Кузьмин Игорь Александрович aefc14ece9 Replace .gitlab-ci.yml 2025-04-18 09:13:59 +00:00
komissarovyv 0e6b5dec52 Merge branch 'MSP-5223' into 'main'
Resolve MSP-5223

Closes MSP-5223

See merge request isp/isp-config-service!7
2025-04-17 14:50:09 +00:00
Кузнецов Иван Александрович 2a424699d7 MSP-5223 composition struct domain.Config in domain.CreateUpdateConfigResponse 2025-04-17 15:23:36 +03:00
Кузнецов Иван Александрович 3c19a8d532 MSP-5223 update response CreateUpdateConfig: add IsChanged field 2025-04-16 16:05:17 +03:00
Кузнецов Иван Александрович 28be68322c MSP-5223 update compare actual data config and update request data config 2025-04-15 19:00:41 +03:00
Кузнецов Иван Александрович 867fd98bce MSP-5223 update naming + update changelog.md 2025-04-15 15:22:24 +03:00
Кузнецов Иван Александрович 1d3bacd22c MSP-5223 add endpoint /config/config/sync_config 2025-04-15 13:59:34 +03:00
Кузнецов Иван Александрович a483722e1d MSP-5223 update CreateUpdateConfig: add case equal name and data config 2025-04-15 13:29:27 +03:00
Кузнецов Иван Александрович 6ab012444f MSP-5223 UpdateConfigName not update field updated_at 2025-04-15 10:18:36 +03:00
Кузнецов Иван Александрович 57f58e7fb7 MSP-5223 rename field UpdateConfigNameRequest ConfigId -> Id 2025-04-15 10:10:46 +03:00
Кузнецов Иван Александрович a51aae9b69 MSP-5223 UpdateConfigNameRequest change field OldConfigName -> ConfidId + change ConfigVersion.CreatedAt actualCfg.CreatedAt -> actual.UpdatedAt 2025-04-14 19:17:04 +03:00
Кузнецов Иван Александрович 4214bd3f20 MSP-5223 swagger for UpdateConfigName 2025-04-14 19:17:04 +03:00
Кузнецов Иван Александрович a0b2a75c9d MSP-5223 GetAllVersion add handler entity.ErrConfigNotFound 2025-04-14 19:17:04 +03:00
Кузнецов Иван Александрович 159db8114e MSP-5223 bump version to 3.3.0 2025-04-14 19:16:57 +03:00
Кузнецов Иван Александрович a7b203bcd0 MSP-5223 implement handler config/config/update_config_name 2025-04-14 11:50:25 +03:00
Кузнецов Иван Александрович d0b55947c5 MSP-5223 configHistory.CreatedAt = oldConfig.UpdatedAt 2025-04-11 14:33:18 +03:00
Кузнецов Иван Александрович a3c65a1434 MSP-5223 generate new swagger 2025-04-11 14:16:24 +03:00
Кузнецов Иван Александрович 29c1a4deeb MSP-5223 update .golangci.yml + fix linters 2025-04-11 14:15:30 +03:00
Кузнецов Иван Александрович ee44e68af9 MSP-5223 update deps 2025-04-11 13:38:21 +03:00
Кузнецов Иван Александрович 7a426b647b MSP-5223 sort imports 2025-04-11 13:36:48 +03:00
Кузнецов Иван Александрович 9d299beaf6 MSP-5223 add actual config in GetAllVersions 2025-04-11 13:31:08 +03:00
komissarovyv 7a1d882248 Merge branch 'v3' into 'main'
V3

See merge request isp/isp-config-service!6
2025-03-24 12:29:17 +00:00
komissarovyv ab95da7242 MSP-5013 change variable error 2025-03-24 15:26:59 +03:00
komissarovyv f63bf4a9f1 MSP-5013 make description optional 2025-03-19 18:32:09 +03:00
komissarovyv a9d4b96305 MSP-5013 bump dependencies 2025-03-12 12:08:01 +03:00
komissarovyv cedb376a91 MSP-5013 use simple regexp to inject variables 2025-03-11 15:52:45 +03:00
komissarovyv 93d09a779d MSP-5013 hack jinja variables 2025-03-11 14:01:30 +03:00
komissarovyv 41fa496052 MSP-5013 fix test 2025-03-10 17:28:15 +03:00
komissarovyv 398d537d8a MSP-5013 unmarshal fix 2025-03-06 15:43:02 +03:00
komissarovyv c501354be1 MSP-5013 unmarshal fix 2025-03-06 15:40:54 +03:00
komissarovyv 7852772e9d MSP-5013 fix get by name 2025-03-06 14:56:01 +03:00
komissarovyv efc4a4ee38 MSP-5013 change routes 2025-03-06 11:53:04 +03:00
komissarovyv 25c07ef016 MSP-5013 bump version 2025-03-06 11:18:51 +03:00
komissarovyv b3511f018a MSP-5013 bump version 2025-03-06 11:10:15 +03:00
komissarovyv 46ba9541eb MSP-5013 reinit go mod 2025-03-06 11:03:01 +03:00
komissarovyv ecf2d06cfa MSP-5013 add full variable support 2025-03-05 18:10:07 +03:00
komissarovyv d6a8f77610 MSP-5013 Update doc 2025-03-03 17:32:13 +03:00
komissarovyv be0dea3702 MSP-5013 Add variables swagger 2025-03-03 15:23:03 +03:00
komissarovyv 148327c74e MSP-5013 Handle error in rqlite response 2025-03-03 15:22:54 +03:00
komissarovyv eed94a4920 MSP-5013 Disable logs in rqlite client by default 2025-03-03 15:22:46 +03:00
komissarovyv e47646c953 MSP-5013 Update dependencies 2025-03-03 15:22:38 +03:00
Кузьмин Игорь Александрович 69567c4869 Upload New File 2024-12-27 13:42:14 +00:00
Кузьмин Игорь Александрович 7a00dd1794 Upload New File 2024-12-27 13:41:48 +00:00
komissarovyv 5fbfe1b039 Add logs 2024-12-12 13:52:08 +03:00
komissarovyv 8f9dc2048f Merge branch 'v3' into 'master'
Add service

See merge request isp/isp-config-service!5
2024-11-27 09:08:46 +00:00
komissarovyv ca70e4a038 Add service 2024-11-27 12:07:45 +03:00
komissarovyv 16d2701e26 Merge branch 'v3' into 'master'
V3

See merge request isp/isp-config-service!4
2024-11-26 16:07:20 +00:00
komissarovyv 005510e0a5 Return default addresses 2024-11-26 19:04:50 +03:00
komissarovyv 5ba6913d5f Add disco mode support 2024-11-26 16:29:46 +03:00
komissarovyv c3400ab6cd Change migrate tool port 2024-11-20 17:06:52 +03:00
komissarovyv 83355f8bbc Move migrate tool to container 2024-11-20 14:31:52 +03:00
komissarovyv 93f2a5ed50 Merge branch 'v3' into 'master'
V3

Closes MSP-4227 and MSP-4182

See merge request isp/isp-config-service!1
2024-11-15 10:02:52 +00:00
komissarovyv 120abaf6dd Update swagger 2024-11-01 19:04:31 +03:00
komissarovyv 2db855d360 Pass backend connection id 2024-11-01 18:58:16 +03:00
komissarovyv 7aa2805f4c Clean phantom backends 2024-11-01 18:41:17 +03:00
komissarovyv 1342f0dcf2 Close cluster client 2024-10-29 21:54:01 +03:00
komissarovyv 4f4fb5e6c7 Clean events only on leader 2024-10-29 18:11:36 +03:00
komissarovyv 68c8681a9b Keep only last N config versions 2024-10-29 17:41:03 +03:00
komissarovyv cb8c66849a Fix migration 2024-10-29 12:48:33 +03:00
komissarovyv 3f60267bdc Fix migration 2024-10-29 12:35:31 +03:00
komissarovyv 43a1a206d5 Bump dependencies 2024-10-29 12:04:52 +03:00
komissarovyv d4badbb8db Return prev module id 2024-10-28 22:17:10 +03:00
komissarovyv 5346030323 Fix maintaince proxy 2024-10-28 21:44:54 +03:00
komissarovyv c32c9d5eba Implement auth 2024-10-28 20:24:48 +03:00
komissarovyv 000a5aacdf Merge branch 'MSP-4227' into 'v3'
Resolve MSP-4227

See merge request isp/isp-config-service!3
2024-10-16 08:06:58 +00:00
Пучков Андрей Павлович 62815a7691 MSP-4227 Bump version to 3.0.2 2024-10-14 16:51:19 +03:00
Пучков Андрей Павлович e52c0f760c MSP-4227 fix module name 2024-10-14 16:51:05 +03:00
komissarovyv bfe2a7f817 Merge branch 'MSP-4182' into 'v3'
Resolve MSP-4182

See merge request isp/isp-config-service!2
2024-10-02 07:41:41 +00:00
Синельник Тимур Романович 99c0e1b17d MSP-4182 Bump version to 3.0.1 2024-10-02 10:22:17 +03:00
Синельник Тимур Романович e1547dbb94 MSP-4182 Add autoincrement to isp_config_service__event id field 2024-10-02 10:02:25 +03:00
komissarovyv 38c4295d0b Use match elements 2024-09-08 09:36:16 +03:00
komissarovyv 3a9e163c9e Bump rqlited 2024-09-07 10:51:30 +03:00
d1slike 0065c7c5a7 Add migration tool 2024-05-24 18:26:39 +03:00
d1slike fb21d43425 Use idempotent module id 2024-05-24 16:26:00 +03:00
d1slike 13c5ed92f4 Do not check is response is array (fix panic) 2024-05-24 13:25:18 +03:00
Кузьмин Игорь Александрович c3d626f074 Update config.yml 2024-05-20 15:40:03 +00:00
d1slike a6fa3eee8a Reimplement disovery service 2024-05-17 11:37:03 +03:00
d1slike bf024474d1 Implement missing endpoint 2024-05-16 20:31:18 +03:00
d1slike 2228e02770 Implement missing endpoint 2024-05-16 20:27:40 +03:00
d1slike d7d17e7f13 Add Dockerfile 2024-05-15 14:42:52 +03:00
d1slike 9bc9655c3d Add Dockerfile 2024-05-15 14:39:25 +03:00
d1slike 0320131d57 Add log level 2024-05-15 13:54:40 +03:00
d1slike 8275c01d21 Align to CI 2024-05-15 12:44:39 +03:00
d1slike 125013ba0a Implement acceptance test 2024-05-14 19:21:19 +03:00
d1slike 3b34468842 Improve logging 2024-05-14 14:34:13 +03:00
d1slike cddd3383e8 Implement api 2024-05-12 16:35:33 +03:00
d1slike c6148a1c1c Implement api 2024-05-08 18:45:21 +03:00
d1slike b2e34c00a4 Implement api 2024-05-08 15:40:14 +03:00
d1slike 80a99c425b Implement event stream 2024-05-07 20:16:44 +03:00
d1slike f90063cb03 Add go.sum 2024-05-06 20:18:15 +03:00
d1slike c4abdaa54b Implement lifecycle 2024-05-06 20:09:14 +03:00
d1slike 8a2a65d8ed Implement lifecycle 2024-05-06 09:43:11 +03:00
d1slike 2e23e882bb Implement lifecycle 2024-05-03 18:24:07 +03:00
d1slike 4e96b7a930 Reimplement 2024-05-03 17:46:22 +03:00
d1slike 5e72ec3864 Fix build 2024-04-24 17:56:48 +03:00
d1slike 05eb762273 Fix data 2024-04-24 17:34:03 +03:00
Кузьмин Игорь Александрович e2419e2c4b Update file README.md 2024-03-25 14:40:05 +00:00
Кузьмин Игорь Александрович 72afc94782 Update README.md 2024-03-25 14:04:00 +00:00
Кузьмин Игорь Александрович 02070b1db1 Update file README.md 2024-03-25 13:50:01 +00:00
Кузьмин Игорь Александрович 2fc6c7ba91 Delete Dockerfile.dit 2024-03-25 13:16:38 +00:00
Кузьмин Игорь Александрович c706d7932d Delete .gitlab-ci.yml 2024-03-25 13:16:28 +00:00
Кузьмин Игорь 62714cdfe1 Upload New File 2023-05-10 08:44:16 +00:00
Кузьмин Игорь a2c49ac39f Add new file 2023-05-03 10:11:43 +00:00
komissarovyv de55ea643c Merge branch 'deps' into 'master'
Deps

See merge request integration-system/isp-config-service!6
2022-12-09 09:09:04 +00:00
d1slike 5fb60e14b8 Ignore test 2022-12-08 16:35:34 +03:00
d1slike 02603cb018 Bump version 2022-12-08 16:22:25 +03:00
d1slike ffbff595d1 Remove ci 2022-12-08 16:18:01 +03:00
d1slike 989429824e Upgrade dependencies 2022-12-08 16:18:01 +03:00
Кузьмин Игорь a31e6080e2 Update default_remote_config.json 2022-11-29 11:56:09 +00:00
Кузьмин Игорь 90e05dfb4b Add new file 2022-11-29 11:51:08 +00:00
Мержанов Максим Владимирович 2af27ddb68 Merge branch 'remove_instance_uuid' into 'master'
remove instanceUuid

See merge request integration-system/isp-config-service!5
2021-05-26 14:08:58 +00:00
Maxim Merzhanov d004faa9e0 remove instanceUuid 2021-05-25 18:39:58 +03:00
Мержанов Максим Владимирович 45a4a23112 Merge branch '__deps' into 'master'
Update dependencies

See merge request integration-system/isp-config-service!4
2021-05-18 12:09:02 +00:00
Egor Kiryushchenko 1bb50f8175 Update dependencies 2021-05-17 16:22:07 +03:00
Мержанов Максим Владимирович 0cbfcab3f9 Merge branch 'bugfixes' into 'master'
Bugfixes

See merge request integration-system/isp-config-service!3
2021-05-14 09:36:25 +00:00
Maxim Merzhanov d4125963b2 update CHANGELOG.md 2021-05-13 17:35:22 +03:00
Maxim Merzhanov 2e33c2275c address review comments
- increase shutdown limit to 10/11 sec as it was set in isp-lib/bootstrap
- refactor
- update libs versions to released
2021-05-13 17:04:15 +03:00
Maxim Merzhanov a5b21198e0 cluster: reduce websocket read buffer from 10 to 1 2021-04-30 18:05:06 +03:00
Maxim Merzhanov e765cda3f9 add timeouts to all websocket emits 2021-04-30 13:09:52 +03:00
Maxim Merzhanov 5a91184d6c fix deadlock in cluster client 2021-04-22 19:25:35 +03:00
Maxim Merzhanov e2094296f4 fix race in test (TimeoutRetryer.Do needs to be fixed in isp-lib-test) 2021-04-22 19:16:26 +03:00
Maxim Merzhanov 777e856d00 fix potential error shadowing when leader apply log, but return nil instead of ApplyLogResponse 2021-04-21 17:04:48 +03:00
Maxim Merzhanov c3f419bbc5 update raft lib, improve raft logging 2021-04-21 16:47:59 +03:00
Maxim Merzhanov 52705f6982 fix hanging on graceful shutdown 2021-04-21 16:47:59 +03:00
Maxim Merzhanov a5134181be add integration test for multiple config updates 2021-04-19 10:25:43 +03:00
Maxim Merzhanov 79c801d493 add metric server 2021-04-05 18:42:54 +03:00
Maxim Merzhanov f9823d5303 fix version config store test 2021-04-01 18:55:08 +03:00
Maxim Merzhanov 8339591b27 fix leader address race on leader disconnect 2021-04-01 18:36:12 +03:00
Maxim Merzhanov 17a6e3186d fix a couple of data races 2021-04-01 16:54:42 +03:00
Maxim Merzhanov 213bad9722 increase default version config count to 15 2021-04-01 16:47:44 +03:00
Maxim Merzhanov ef33bd9fd2 up test lib, fix grpc awaiting 2021-03-10 11:41:36 +03:00
Мержанов Максим Владимирович 123de3d452 Merge branch '__deps' into 'master'
Update dependencies

See merge request integration-system/isp-config-service!2
2021-01-26 19:21:26 +03:00
Egor Kiryushchenko 6591bff728 Update dependencies 2021-01-26 13:52:14 +03:00
Maxim Merzhanov 88c0779aa2 fix marshaling body of ERROR_CONNECTION event 2021-01-15 16:05:47 +03:00
Максим Мержанов 95adcb117c Merge branch '__deps' into 'master'
Update dependencies

See merge request integration-system/isp-config-service!14
2020-11-24 16:56:15 +03:00
Egor Kiryushchenko 372636f43b Update dependencies 2020-11-24 09:42:16 +03:00
Maxim Merzhanov 54dae1ab2b fix test 2020-11-23 10:47:08 +03:00
Egor Kiryushchenko f0f50a8507 fix lint 2020-11-20 16:46:46 +03:00
Egor Kiryushchenko c3d0d5be4c Update dependencies 2020-11-19 10:29:59 +03:00
DeniskaRediska 929132743c up version 2020-10-22 15:51:52 +03:00
DeniskaRediska 6643e8937c add db pass part 2020-10-22 15:49:25 +03:00
Максим Мержанов 08b4ee461e Merge branch 'api_ext_branch' into 'master'
add valid property to method `/config/get_configs_by_module_id`

See merge request integration-system/isp-config-service!6
2020-09-28 16:08:21 +03:00
Рябов Владислав Олегович ae501969bf add valid property to method /config/get_configs_by_module_id 2020-09-28 16:08:21 +03:00
Максим Мержанов c29ed6d41e Merge branch 'api_ext_branch' into 'master'
add new config methods

See merge request integration-system/isp-config-service!5
2020-09-24 22:08:50 +03:00
Рябов Владислав Олегович 1c28c895b5 add new config methods 2020-09-24 22:08:50 +03:00
d1slike d9c32437c9 remove utc 2020-07-15 17:37:22 +03:00
d1slike 0429bed9e3 up version 2020-07-15 17:33:06 +03:00
DeniskaRediska 8bdc36a302 up created_at for version_config 2020-07-10 19:48:09 +03:00
DeniskaRediska a3576cc3f4 add created_at for version_config 2020-07-10 19:38:35 +03:00
DeniskaRediska 713db0aa4c reverse version config 2020-07-10 19:26:35 +03:00
d1slike 95aae06a41 downgrade version 2020-06-09 14:42:36 +03:00
DeniskaRediska 31a4a6f5b8 ref 2020-06-09 13:55:39 +03:00
DeniskaRediska 1c66729974 fix generate version id 2020-06-09 13:41:56 +03:00
d1slike 6387947b22 small ref 2020-06-09 12:57:07 +03:00
DeniskaRediska 3a8469c5a9 fix test 2020-06-08 20:44:54 +03:00
DeniskaRediska 44715591ef fix lint 2020-06-08 20:14:50 +03:00
DeniskaRediska ceb9d71a1a fix lint 2020-06-08 20:11:53 +03:00
DeniskaRediska 15ad05277b add config version 2020-06-08 18:39:25 +03:00
d1slike 14c5b0a678 fix broadcasting config on activating and upserting configs 2020-06-03 15:43:05 +03:00
d1slike c95964fa3c get module dependencies from first connected backend 2020-06-03 14:35:11 +03:00
d1slike a46f2cee34 Merge remote-tracking branch 'origin/required_modules' into feat_broadcasting
# Conflicts:
#	go.mod
#	go.sum
2020-06-03 14:10:14 +03:00
d1slike 1764ce9a30 Merge remote-tracking branch 'origin/add_conf_version' into feat_broadcasting
# Conflicts:
#	go.mod
#	go.sum
2020-06-03 14:09:57 +03:00
DeniskaRediska 384fa0417a add config version 2020-06-03 11:33:52 +03:00
Maxim Merzhanov 97ba1050a7 appease linter 2020-06-02 18:19:33 +03:00
Maxim Merzhanov 628c506e85 list required modules in get_modules_info method 2020-06-02 17:06:02 +03:00
d1slike 9226796463 broadcasting to modules 2020-06-01 19:35:22 +03:00
Maxim Merzhanov 83176ba878 update doc 2020-03-24 13:24:16 +03:00
Maxim Merzhanov 94cb067214 refactor sync apply helpers 2020-03-23 18:31:47 +03:00
Maxim Merzhanov b56b6e0e42 update isp-etp lib 2020-03-23 17:51:30 +03:00
Maxim Merzhanov 28aa3eae33 add module/broadcast_event method 2020-03-23 16:49:21 +03:00
Maxim Merzhanov 96dee8dee3 stringify cluster commands in log 2020-03-23 12:49:34 +03:00
Maxim Merzhanov 400410c449 up version 2020-03-23 12:17:37 +03:00
Maxim Merzhanov ab08abb3f6 fix integration test 2020-03-23 11:50:04 +03:00
Maxim Merzhanov 01e32537a8 update docs 2020-03-23 11:21:23 +03:00
Maxim Merzhanov 652d1c8c4f update isp-lib and go-pg 2020-03-23 11:16:30 +03:00
Maxim Merzhanov 64e7792778 up version 2020-03-16 14:22:13 +03:00
Maxim Merzhanov bfb03c6d1e migrate to go modules 2020-03-16 14:20:10 +03:00
Maxim Merzhanov 1fa20f9cda add linter, refactor 2020-03-12 13:12:43 +03:00
Maxim Merzhanov 9d61ec49c3 improve logging, regenerate doc 2020-03-06 14:07:59 +03:00
Maxim Merzhanov 9dc598feff up .version file 2020-02-26 17:53:09 +03:00
Maxim Merzhanov 49fde946ac configure leader ws client ConnectionReadLimit 2020-02-26 17:48:46 +03:00
Maxim Merzhanov c4ded39e7c up v2.1.1 2020-01-16 17:55:46 +03:00
Maxim Merzhanov c8518e9f35 update to new EndpointDescriptor 2020-01-16 17:48:58 +03:00
ykomissarov 97d3a38ed8 up v2.1.0 2020-01-16 14:42:30 +03:00
Maxim Merzhanov e840b53978 fix raft store Snapshot and Restore 2020-01-16 14:02:52 +03:00
Maxim Merzhanov c43e52e9ad disable PullImage in tests 2019-12-27 18:56:15 +03:00
Maxim Merzhanov 2a2bd99fcf fix test, add retry on getRoutes command 2019-12-27 18:36:17 +03:00
Maxim Merzhanov c4f9fc4585 fix send on closed channel on raft shutdown 2019-12-27 17:35:45 +03:00
Maxim Merzhanov 0222dfd865 cleanup to satisfy linter 2019-12-27 17:26:48 +03:00
Maxim Merzhanov 11f91b67a8 move mux to separate repo 2019-12-27 17:09:29 +03:00
Maxim Merzhanov 6e2d485b90 fix data race when applyCommandOnLeader in websocket handler; minor fixes 2019-12-24 18:56:06 +03:00
ykomissarov e336a57e13 fix raft server address announcing (serverId == serverAddress == cluster.outerAddress) 2019-12-10 12:47:17 +03:00
Maxim Merzhanov 29e7c119bd integration test: add pause between starting container and checking cluster 2019-11-28 18:41:41 +03:00
Maxim Merzhanov 882228558d add schema docs, hotfix tests 2019-11-28 17:26:15 +03:00
Maxim Merzhanov 51360e802f up version 2019-11-28 16:05:55 +03:00
Maxim Merzhanov 7a06660597 fix nil pointer dereference in repositories
increase default websocket ConnectionReadLimit to 4 MB, add to configuration
2019-11-28 15:41:50 +03:00
Maxim Merzhanov 4553cd0261 cleanup 2019-11-22 18:30:33 +03:00
Maxim Merzhanov 2bbc426bef implement tcp/http mux 2019-11-22 16:53:40 +03:00
Maxim Merzhanov b22a22cac9 add docker IPs calculation to test 2019-11-21 14:22:30 +03:00
Maxim Merzhanov cc7b931e0a set grpcOuterAddress in default config to empty 2019-11-21 13:50:51 +03:00
Maxim Merzhanov d4a44b0d72 add possibility to declare grpcOuterAddress from config, update default config 2019-11-21 11:28:54 +03:00
Maxim Merzhanov 284a9bb444 try remove cmux 2019-11-20 17:26:03 +03:00
Maxim Merzhanov ef4dc0e972 update logging 2019-11-19 17:30:03 +03:00
Maxim Merzhanov def031958b add overriding logging level via env var 2019-11-19 13:24:24 +03:00
Maxim Merzhanov 00c1936683 try cmux.HTTP1Fast() 2019-11-18 19:08:29 +03:00
Maxim Merzhanov cc3aab1e7b add comparing backend declarations 2019-11-18 17:20:05 +03:00
Maxim Merzhanov c14de6d198 add option to BootstrapCluster 2019-11-18 15:08:02 +03:00
Maxim Merzhanov f9f8186451 add integration test
add option to configure raft connection timeout
2019-11-15 18:09:16 +03:00
Maxim Merzhanov 0259cf84ce fix config server address declaration 2019-11-11 17:37:03 +03:00
ykomissarov 04ceb5f4fa remove unused port 2019-11-06 12:09:50 +03:00
ykomissarov 6efcbe7c70 upd 2019-11-06 12:05:55 +03:00
ykomissarov e0ce92a9f3 Merge remote-tracking branch 'origin/v2' into v2_migrate_etp
# Conflicts:
#	Gopkg.lock
2019-11-06 12:04:24 +03:00
Yan 28e08e108a Merge pull request #12 from integration-system/fix_validate_config_status
fix valid config status after update
2019-11-01 12:18:05 +03:00
Maxim Merzhanov 4e68903251 update isp-lib
remove second apply module_connected_command
improve shutdown logging
2019-11-01 11:59:34 +03:00
DeniskaRediska 73515e5179 fix(valid config status after update) 2019-11-01 11:57:24 +03:00
Yan f752770788 Merge pull request #11 from integration-system/v2_validation_config
add validation config
2019-10-31 17:29:14 +03:00
DeniskaRediska 6eb6efe844 ref 2019-10-31 17:27:50 +03:00
DeniskaRediska 837b8755a0 Merge remote-tracking branch 'origin/v2_validation_config' into v2_validation_config
# Conflicts:
#	service/config.go
2019-10-31 17:23:50 +03:00
DeniskaRediska e3b5e867b1 ref 2019-10-31 17:23:03 +03:00
ykomissarov 362efd9546 upd 2019-10-31 17:21:02 +03:00
Maxim Merzhanov a958874731 fix ErrorConnection event format 2019-10-31 17:01:11 +03:00
DeniskaRediska 0d5094cfb5 add(validation config) 2019-10-31 16:17:15 +03:00
ykomissarov 74b32e064e upd 2019-10-30 18:39:20 +03:00
ykomissarov 3ad5dfe030 Merge remote-tracking branch 'origin/v2' into v2_migrate_etp 2019-10-30 15:07:42 +03:00
Maxim Merzhanov 95242965da add announcing config module 2019-10-30 14:53:28 +03:00
Maxim Merzhanov 8c15105087 add cmux multiplexer to run raft and ws on the same port
fix discovery broadcast
2019-10-30 14:00:46 +03:00
Yan db68505cca Update handler.go 2019-10-30 13:21:20 +03:00
ykomissarov 795aee86d1 new api for common configs 2019-10-30 12:50:01 +03:00
ykomissarov 33621ff523 new api for common configs 2019-10-30 12:47:35 +03:00
Maxim Merzhanov 415a694228 remove creating empty default config 2019-10-30 11:06:03 +03:00
Maxim Merzhanov 1fe8b7f78d add common configs unique name constraint 2019-10-29 18:43:06 +03:00
Maxim Merzhanov c2fc3c54da remove leader client reconnection
fix discovery addresses broadcast
2019-10-29 18:24:32 +03:00
Maxim Merzhanov 652c2d95b8 migrate to etp
fix raft logger
2019-10-29 17:24:47 +03:00
ykomissarov da1b6caf67 upd 2019-10-29 14:57:51 +03:00
ykomissarov deafdfb7ab upd 2019-10-29 14:56:56 +03:00
ykomissarov f9feaeab0b upd 2019-10-29 14:54:51 +03:00
Maxim Merzhanov 330c160122 revert SyncApplyCommand logging 2019-10-29 12:15:20 +03:00
Maxim Merzhanov 238c7b3a44 update swagger doc
add ws disconnect when cluster is not initialized
2019-10-29 11:40:45 +03:00
Maxim Merzhanov 1317696cb7 - update CreateUpdateCommonConfig doc
- remove required from ids
2019-10-28 19:10:26 +03:00
Maxim Merzhanov 23108f2224 fix discovery lock 2019-10-25 16:55:02 +03:00
ykomissarov 6b14252577 upd 2019-10-25 16:30:36 +03:00
ykomissarov 8386cd7503 upd 2019-10-25 16:26:33 +03:00
Yan c6225eeb3a Merge pull request #10 from integration-system/v2_grpc_api
implement grpc api
2019-10-25 15:25:11 +03:00
Maxim Merzhanov a12c2fd120 fix common configRep delete and mesh broadcasting 2019-10-25 14:13:52 +03:00
Maxim Merzhanov 9e503ab31f implement grpc api 2019-10-25 12:18:34 +03:00
d1slike c31abb84c9 reformat state access and errors handling 2019-10-12 12:53:20 +03:00
Yan b1a0bc252f Merge pull request #8 from integration-system/v2_send_config_schema
add subscription on send config schema
2019-10-12 10:41:10 +03:00
Yan 599b1639e7 Update config.yml 2019-10-11 19:02:20 +03:00
DeniskaRediska 1199f9ae8e ref 2019-10-11 18:58:11 +03:00
DeniskaRediska cb8ae318c4 add(cluster check 'is leader') 2019-10-11 18:52:44 +03:00
ykomissarov fec8a759bc upd 2019-10-11 18:40:16 +03:00
ykomissarov 5d4b54c39c Merge remote-tracking branch 'origin/v2' into v2_send_config_schema
# Conflicts:
#	Gopkg.lock
#	cluster/const.go
#	store/apply.go
#	store/state/modules.go
#	store/state/state.go
#	store/store.go
#	subs/client.go
2019-10-11 18:22:55 +03:00
Yan 4ebab3a967 Merge pull request #9 from integration-system/v2_backend_store
v2 config sharing
2019-10-11 18:18:18 +03:00
Maxim Merzhanov 73315e6671 move event to metadata in logging 2019-10-11 18:15:24 +03:00
Maxim Merzhanov db03a888fb move commandName to metadata in logging 2019-10-11 18:12:48 +03:00
Maxim Merzhanov 7d4a5c4c6c fix 2019-10-11 18:05:37 +03:00
DeniskaRediska 94397ea4c7 ref 2019-10-11 18:00:31 +03:00
Maxim Merzhanov e05319432e add handling CONFIG:SEND_CONFIG_WHEN_CONNECTED, update modules state 2019-10-11 16:59:25 +03:00
DeniskaRediska f1bce695fb add(subscription on send config schema ) 2019-10-11 16:38:56 +03:00
Yan 7aad2697f7 Merge pull request #7 from integration-system/v2_backend_store
V2 backend store
2019-10-10 16:19:16 +03:00
Maxim Merzhanov 848a2d74d6 fix migrations 2019-10-10 16:13:08 +03:00
Maxim Merzhanov a2a470ad93 refactor, change id to string 2019-10-10 15:05:57 +03:00
ykomissarov 78150b2661 remove unnecessary codes 2019-10-10 13:16:49 +03:00
ykomissarov ed2e1a0936 ref 2019-10-10 13:03:52 +03:00
Maxim Merzhanov 445389b7d8 - implement raft logger
- replace logger with isp-log
- add storage layer (pq)
2019-10-10 11:18:29 +03:00
Yan 1bb8cbf3ab Merge pull request #2 from integration-system/v2_service_discovery
V2 service discovery
2019-09-11 11:45:57 +03:00
Maxim Merzhanov ca6fe7b86e update golang-socketio lib 2019-09-11 10:25:53 +03:00
Maxim Merzhanov 0b351ea3a2 - updated golang-socketio lib 2019-09-10 14:16:12 +03:00
ykomissarov 05c5db53bd rename func 2019-09-09 16:23:36 +03:00
Maxim Merzhanov 7632e07f4e добавлено анонсирование конфиг сервисов 2019-09-09 12:16:17 +03:00
Maxim Merzhanov 1ddbe43618 fix 2019-09-04 18:48:54 +03:00
Maxim Merzhanov 79f83e245c refactoring, added DeleteBackendDeclarationCommand 2019-09-04 18:20:11 +03:00
ykomissarov d678f28909 add commnets 2019-09-04 14:45:21 +03:00
Maxim Merzhanov c3e95fa98c done #1 2019-09-04 13:55:07 +03:00
ykomissarov e32e55df15 init 2019-08-02 17:59:51 +03:00
ykomissarov 48eaf48797 init 2019-08-01 14:47:54 +03:00
ykomissarov ead505d40c * update libs
* default config handling
2019-05-13 16:53:43 +03:00
DeniskaRediska a39a53561e add default config 2019-05-13 15:35:06 +03:00
DeniskaRediska ebf715c368 add default config 2019-05-13 15:33:20 +03:00
gryaznovdv 87f2c360c5 added module mode to adapter service 2019-04-04 16:28:26 +03:00
gryaznovdv b0584b4ead added module mode to adapter service 2019-04-04 16:27:32 +03:00
ykomissarov 1575a4cc34 add default config for script service 2019-04-02 16:51:59 +03:00
ykomissarov 1bc12d7a33 remove field filtering for search by default 2019-03-27 14:26:42 +03:00
ykomissarov 89707ff412 package refactoring 2019-03-20 11:05:47 +03:00
ykomissarov 33b9e220d3 package refactoring 2019-03-20 11:05:17 +03:00
ykomissarov d3e39f66a2 reformat 2019-03-18 16:10:09 +03:00
ykomissarov 48a991e11b update lib 2019-03-18 14:02:04 +03:00
ykomissarov 3ef79e51ca update lib 2019-03-18 11:25:03 +03:00
ykomissarov d945add7a0 config for api service 2019-03-05 11:43:12 +03:00
ykomissarov 2e0e25de42 try use ack 2019-03-05 10:58:29 +03:00
ykomissarov 334043947a try use ack 2019-03-05 10:57:56 +03:00
ykomissarov e5e8f2b962 migration for async api service 2019-03-05 10:30:01 +03:00
ykomissarov a16ecbc8a9 new config for mdm 2019-03-01 12:04:34 +03:00
ykomissarov 3c6e9c75a9 up version 2019-02-26 13:11:24 +03:00
ykomissarov 980bcb2eb5 upd 2019-02-20 19:02:10 +03:00
ykomissarov 3b73722bca upd 2019-02-20 16:23:44 +03:00
ykomissarov 15f7a970b1 test config 2019-02-20 12:05:49 +03:00
ykomissarov e6083dbe81 migration for dumper service 2019-02-19 11:34:23 +03:00
logicalslice 54a77441fd Update 00013_2018-08-29_add_default_config_for_senders.sql 2019-01-29 20:02:38 +03:00
Andrey Savchuk 353cf671da update module 2019-01-29 16:22:40 +03:00
Andrey Savchuk 02c280009b bump version 2019-01-29 15:50:53 +03:00
Andrey Savchuk 379db84504 Merge branch 'master' of work.github.com:integration-system/isp-config-service 2019-01-29 15:49:39 +03:00
logicalslice bd56df8ed8 Create LICENSE 2019-01-29 15:22:17 +03:00
37 changed files with 2307 additions and 331 deletions

No files matched your search

+2
View File
@@ -8,6 +8,8 @@ linters:
- depguard # не всегда имеет смысл
- dupword # не имеет смысла
- exhaustruct # не имеет смысла
- exhaustruct_v5 # не имеет смысла
- goconst # не всегда имеет смысл
- godot # не актуально для swagger
- godox # не позволяет оставлять todo
- musttag # у нас собственное правило: не используем теги, если работаем с пакетом isp-kit/json и с внутренними структурами(между нашими сервисами), при этом теги обязательный для всех внешних для нас структур
+1 -1
View File
@@ -1 +1 @@
3.11.0
3.12.1
+1 -1
View File
@@ -1,4 +1,4 @@
FROM golang:1.26-alpine AS builder
FROM golang:1.27-alpine AS builder
WORKDIR /build
ARG version
ENV version_env=$version
+1 -1
View File
@@ -1,5 +1,5 @@
FROM dockerhub.mos.ru/mosos/arbat:15.5 as builder
RUN zypper --no-gpg-checks update -y && zypper --no-gpg-checks install -y go1.26 git
RUN zypper --no-gpg-checks update -y && zypper --no-gpg-checks install -y go1.27 git
WORKDIR /build
ARG version
ENV version_env=$version
+13
View File
@@ -1,3 +1,16 @@
### v3.12.1
* Обновление ограничений конфигурации: в параметре `KeepConfigVersions` допустимо значение `0`
### v3.12.0
* Обновлен isp-kit до v1.76.0: подтянуты транзитивные зависимости (grpc v1.85.0, otel v1.47.0, goose v3.30.1, prometheus/client_golang v1.25.0), сервис собирается на Go 1.27
* Добавлена колонка `module_leader_mode` в таблицу `isp_config_service__backend` — режим выбора лидера, объявленный инстансом в `MODULE:READY`. Любое значение, кроме `REQUEST_ELECTION` (в том числе зарезервированные `IM_LEADER` и `IM_FOLLOWER`), нормализуется в пустое значение с логом уровня `warn`, рукопожатие при этом не отклоняется
* Для модулей, объявивших `REQUEST_ELECTION`, список адресов в событии `{module}_MODULE_CONNECTED` и карта маршрутов в `CONFIG:SEND_ROUTES_*` сузены до одного инстанса — лидера, а когда инстансов не осталось — до пустого списка. Модули без election не затронуты
* Лидер выводится из подключённых инстансов (минимум по `created_at`, тай-брейк по `ws_connection_id`) и нигде не хранится: ни новой таблицы, ни колонки «лидер/не лидер» нет
* Расширен ответ по `/module/get_modules_info` и `/routing/get_routes`: поле `isModuleLeader` в `domain.Connection`. `/routing/get_routes` остался полным — все инстансы всех модулей; сужение касается только событий, уходящих модулям
* Сужение видно в логах: публикация списка адресов модуля с election пишет `info` с адресом лидера, пересборка карты маршрутов — одной строкой список опубликованных лидеров (`модуль=адрес` через запятую). Модули без election по-прежнему не шумят
### v3.11.1
* Исправлено: при сохранении конфига с многократным использованием одной переменной через `_Var()` терялись все связи переменной с конфигами (конфликт PK в транзакции ссылок)
* Ошибки statement в rqlite-транзакциях больше не игнорируются молча, возвращаются как ошибка запроса
* Отключены линтеры `exhaustruct_v5`, `goconst`
### v3.11.0
* Добавлены `admin` permission к endpoint'ам
### v3.10.0
+39 -38
View File
@@ -1,15 +1,14 @@
module isp-config-service/migrate
go 1.26
go 1.27
replace isp-config-service => ../..
require (
github.com/jmoiron/sqlx v1.4.0
github.com/mattn/go-sqlite3 v1.14.47
github.com/pkg/errors v0.9.1
github.com/pressly/goose/v3 v3.27.2
github.com/txix-open/isp-kit v1.71.1
github.com/pressly/goose/v3 v3.30.1
github.com/txix-open/isp-kit v1.76.0
isp-config-service v0.0.0-00010101000000-000000000000
)
@@ -19,59 +18,61 @@ require (
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/coder/websocket v1.8.15 // indirect
github.com/gabriel-vasile/mimetype v1.4.13 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/gabriel-vasile/mimetype v1.4.16 // indirect
github.com/go-logr/logr v1.4.4 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/locales v0.14.2 // indirect
github.com/go-playground/universal-translator v0.18.2 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.34.0 // indirect
github.com/iancoleman/strcase v0.3.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
github.com/jackc/pgx/v5 v5.10.0 // indirect
github.com/jackc/puddle/v2 v2.2.2 // indirect
github.com/jackc/pgx/v5 v5.13.0 // indirect
github.com/jackc/puddle/v2 v2.2.4 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.19.0 // indirect
github.com/klauspost/compress v1.20.4 // indirect
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/mfridman/interpolate v0.0.2 // indirect
github.com/leodido/go-urn v1.5.0 // indirect
github.com/mfridman/interpolate v0.2.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/prometheus/client_golang v1.23.2 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/common v0.69.0 // indirect
github.com/prometheus/procfs v0.21.1 // indirect
github.com/sethvargo/go-retry v0.3.0 // indirect
github.com/pandatix/go-abnf v0.5.5 // indirect
github.com/prometheus/client_golang v1.25.0 // indirect
github.com/prometheus/client_model v0.6.3 // indirect
github.com/prometheus/common v0.74.0 // indirect
github.com/prometheus/procfs v0.23.0 // indirect
github.com/sethvargo/go-retry v0.5.0 // indirect
github.com/tidwall/gjson v1.18.0 // indirect
github.com/tidwall/match v1.2.0 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
github.com/txix-open/bellows v1.2.0 // indirect
github.com/txix-open/etp/v4 v4.1.1 // indirect
github.com/txix-open/validator/v10 v10.0.0-20250506161033-f8ce404fffdb // indirect
github.com/txix-open/etp/v4 v4.1.3 // indirect
github.com/txix-open/validator/v10 v10.0.0-20261027072444-85f3391fc5c3 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.69.0 // indirect
go.opentelemetry.io/otel v1.44.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.44.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.44.0 // indirect
go.opentelemetry.io/otel/metric v1.44.0 // indirect
go.opentelemetry.io/otel/sdk v1.44.0 // indirect
go.opentelemetry.io/otel/trace v1.44.0 // indirect
go.opentelemetry.io/proto/otlp v1.10.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.72.0 // indirect
go.opentelemetry.io/otel v1.47.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect
go.opentelemetry.io/otel/log v1.47.0 // indirect
go.opentelemetry.io/otel/metric v1.47.0 // indirect
go.opentelemetry.io/otel/sdk v1.47.0 // indirect
go.opentelemetry.io/otel/trace v1.47.0 // indirect
go.opentelemetry.io/proto/otlp v1.11.1 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.28.0 // indirect
golang.org/x/crypto v0.54.0 // indirect
golang.org/x/net v0.57.0 // indirect
golang.org/x/sync v0.22.0 // indirect
golang.org/x/sys v0.47.0 // indirect
golang.org/x/text v0.40.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20260630182238-925bb5da69e7 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260724162435-b2f20204f0df // indirect
google.golang.org/grpc v1.82.1 // indirect
google.golang.org/protobuf v1.36.11 // indirect
golang.org/x/crypto v0.59.0 // indirect
golang.org/x/net v0.63.0 // indirect
golang.org/x/sync v0.25.0 // indirect
golang.org/x/sys v0.50.0 // indirect
golang.org/x/text v0.44.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20261118221215-c8830f628b3f // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20261118221215-c8830f628b3f // indirect
google.golang.org/grpc v1.85.0 // indirect
google.golang.org/protobuf v1.36.12 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
+104 -108
View File
@@ -15,32 +15,28 @@ github.com/coder/websocket v1.8.15 h1:6B2JPeOGlpff2Uz6vOEH1Vzpi0iUz20A+lPVhPHtNU
github.com/coder/websocket v1.8.15/go.mod h1:NX3SzP+inril6yawo5CQXx8+fk145lPDC6pumgx0mVg=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/gabriel-vasile/mimetype v1.4.13 h1:46nXokslUBsAJE/wMsp5gtO500a4F3Nkz9Ufpk2AcUM=
github.com/gabriel-vasile/mimetype v1.4.13/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=
github.com/getsentry/sentry-go v0.47.0 h1:AnSMSyrYA5qZCIN/2xpgAAwv63sVULV+vBq37ajouc8=
github.com/getsentry/sentry-go v0.47.0/go.mod h1:h+b4VHpKnK7aUXB5wc+KDnPgp9ZtfliRD4eV85FbiSA=
github.com/dustin/go-humanize v1.1.0 h1:dbKTrvD0klcbBV/h4AWJdMuZogJACoMlvWIWZ5b2xWg=
github.com/dustin/go-humanize v1.1.0/go.mod h1:hc1CvRkJMsgxqjmjMQF3QNRAZBwY8AXBAzKYoSX9sFI=
github.com/felixge/httpsnoop v1.1.0 h1:3YtUj32ZZkqZtt3sZZsClsymw/QDuVfpNhoA31zeORc=
github.com/felixge/httpsnoop v1.1.0/go.mod h1:Zqxgdd+1Rkcz8euOqdr7lqgCRJztwr5hp9vDSi5UZCE=
github.com/gabriel-vasile/mimetype v1.4.16 h1:5izNFuvA37st1dDRAcA7TtmngBmRgiIPDmTtiEvjx1E=
github.com/gabriel-vasile/mimetype v1.4.16/go.mod h1:3oFFwxX8kTklZwzIl2aQEDZT0lKY8xH92ST88bAwba4=
github.com/getsentry/sentry-go v0.50.0 h1:gkO59rn/i0RCAXUUTflC5QVbTQGPXbaFabs2olVzc9g=
github.com/getsentry/sentry-go v0.50.0/go.mod h1:+xsDuN+SoRN/xfs1hdq78wnrE3omIZf+FCuh9FOW1C8=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/logr v1.4.4 h1:tG4xh9yMsRCAiodLVTxyrkzSZ9+o0L1Kg/+cPVcbP/8=
github.com/go-logr/logr v1.4.4/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
github.com/go-resty/resty/v2 v2.17.2 h1:FQW5oHYcIlkCNrMD2lloGScxcHJ0gkjshV3qcQAyHQk=
github.com/go-resty/resty/v2 v2.17.2/go.mod h1:kCKZ3wWmwJaNc7S29BRtUhJwy7iqmn+2mLtQrOyQlVA=
github.com/go-playground/locales v0.14.2 h1:d8UmcrM6Nip0hfGZKLGpAvZH37XB4TS0xzK9B56YNCY=
github.com/go-playground/locales v0.14.2/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
github.com/go-playground/universal-translator v0.18.2 h1:LCsMLC9RzmbUMNUPVYD15dmcjwYAJhmX8mPZRW4rAVU=
github.com/go-playground/universal-translator v0.18.2/go.mod h1:67VZIMp5lQpDWlnStOct22q1bkdJGJqHghbOtmkawxk=
github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=
github.com/go-sql-driver/mysql v1.10.0 h1:Q+1LV8DkHJvSYAdR83XzuhDaTykuDx0l6fkXxoWCWfw=
github.com/go-sql-driver/mysql v1.10.0/go.mod h1:M+cqaI7+xxXGG9swrdeUIoPG3Y3KCkF0pZej+SK+nWk=
github.com/go-sql-driver/mysql v1.10.1 h1:arlSnNLq6a5yxGxV7qg9lF4j0C+KwD6NbQyKr9QL6ME=
github.com/go-sql-driver/mysql v1.10.1/go.mod h1:M+cqaI7+xxXGG9swrdeUIoPG3Y3KCkF0pZej+SK+nWk=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
@@ -48,26 +44,26 @@ github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0 h1:5VipnvEpbqr2gA2VbM+nYVbkIF28c5ZQfqCBQ5g2xfk=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0/go.mod h1:Hyl3n6Twe1hvtd9XUXDec4pTvgMSEixRuQKPTMH2bNs=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.34.0 h1:vzlTzzi4tHLa/JQdIE5LeXw6SEX5EVVhq/VPqKHnKOk=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.34.0/go.mod h1:FHXQZnW5pA0txiMr3jApv9uNJzZ+7mYZd+u+PPenCFU=
github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI=
github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo=
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM=
github.com/jackc/pgx/v5 v5.10.0 h1:VhSvgU2jSli8o3AqIEOTJr7rZwAEUVo4E4XhR94Zfr0=
github.com/jackc/pgx/v5 v5.10.0/go.mod h1:mal1tBGAFfLHvZzaYh77YS/eC6IX9OWbRV1QIIM0Jn4=
github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo=
github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=
github.com/jackc/pgx/v5 v5.13.0 h1:Hl08k64maU0nrRyVUEbwCnK6/gT0EhMrtAqBHz9/gA4=
github.com/jackc/pgx/v5 v5.13.0/go.mod h1:u2Fi6no03HCSBYE+ZVdLxbwdu3xyi2vU+K/YNJioSds=
github.com/jackc/puddle/v2 v2.2.4 h1:N6Mz6EGB9DL0bz3OEfxJ7eoOpjRHnnjpOh+G8kbLoG8=
github.com/jackc/puddle/v2 v2.2.4/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=
github.com/jmoiron/sqlx v1.4.0 h1:1PLqN7S1UYp5t4SrVVnt4nUVNemrDAtxlulVe+Qgm3o=
github.com/jmoiron/sqlx v1.4.0/go.mod h1:ZrZ7UsYB/weZdl2Bxg6jCRO9c3YHl8r3ahlKmRT4JLY=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U=
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
github.com/klauspost/compress v1.19.0 h1:sXLILfc9jV2QYWkzFOPWStmcUVH2RHEB1JCdY2oVvCQ=
github.com/klauspost/compress v1.19.0/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ=
github.com/klauspost/compress v1.20.4 h1:dD0v/bvxtjCBqQu6sx1TNWkalEY5lNTIe+HY9w8TeNI=
github.com/klauspost/compress v1.20.4/go.mod h1:LUdAzn7YLVvxLpc7y3V1m40wESHTgc1422pwwBSKYuI=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
@@ -78,17 +74,17 @@ github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 h1:SOEGU9fKiNWd/HOJuq
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o=
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 h1:P6pPBnrTSX3DEVR4fDembhRWSsG5rVo6hYhAB/ADZrk=
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw=
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
github.com/leodido/go-urn v1.5.0 h1:pLqT2kq1zpHW/1D18QMjMpdtX7cekxqtJJjg5ANyWw0=
github.com/leodido/go-urn v1.5.0/go.mod h1:9BORnCDhdPBJNDEX+w1bJisa8yOKYi116VeO96s4ifE=
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/mattn/go-isatty v0.0.22 h1:j8l17JJ9i6VGPUFUYoTUKPSgKe/83EYU2zBC7YNKMw4=
github.com/mattn/go-isatty v0.0.22/go.mod h1:ZXfXG4SQHsB/w3ZeOYbR0PrPwLy+n6xiMrJlRFqopa4=
github.com/mattn/go-isatty v0.0.24 h1:tGZZoVgT/KiqK1c8ocVLeDS8BSWMRd47J3Lbz7vsReI=
github.com/mattn/go-isatty v0.0.24/go.mod h1:nMCL3Zebbrt45jsMDgnfIwz6ydEQApk5oEI3HqDio6A=
github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
github.com/mattn/go-sqlite3 v1.14.47 h1:jOBI62gS7nKeZv+as1oGEy0+1qISgXwH/QBlR6KbfIo=
github.com/mattn/go-sqlite3 v1.14.47/go.mod h1:6JTjA44L93a0QCyJef5YvlPoKXntQPjzWv5gtm9sB6w=
github.com/mfridman/interpolate v0.0.2 h1:pnuTK7MQIxxFz1Gr+rjSIx9u7qVjf5VOoM/u6BbAxPY=
github.com/mfridman/interpolate v0.0.2/go.mod h1:p+7uk6oE07mpE/Ik1b8EckO0O4ZXiGAfshKBWLUM9Xg=
github.com/mfridman/interpolate v0.2.0 h1:HM9ID8p6CUxoMJX+fECOtGQ2Mu7TW/GIMPyu48nnvUg=
github.com/mfridman/interpolate v0.2.0/go.mod h1:8SfDy95IaPNnIokZh9mvIppmc3fGl8fx+Gu7uusuO9Q=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -98,29 +94,27 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/ncruces/go-strftime v1.0.0 h1:HMFp8mLCTPp341M/ZnA4qaf7ZlsbTc+miZjCLOFAw7w=
github.com/ncruces/go-strftime v1.0.0/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/ncruces/go-strftime v1.1.0 h1:vtPmPWMkb539RGV9WpWT9EwJGvrOCKvMNI4obWL47Hk=
github.com/ncruces/go-strftime v1.1.0/go.mod h1:yVaq7iwCN09vHRrKBrrflXT0M9tTMG2KmZ9Fj7xeG/g=
github.com/pandatix/go-abnf v0.5.5 h1:EXex5KkRQx4Dm6GnpAcQnIMBs9KiK0uf8p/wq+4t9PM=
github.com/pandatix/go-abnf v0.5.5/go.mod h1:AE0KD3/VNoCjGzc1gqetRKshbI4SYErXQ/8kPenR5mc=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pressly/goose/v3 v3.27.2 h1:FjKNzcmMdGrQlSIu5alMSmakQtJFBgtw+A0bb1p/LC8=
github.com/pressly/goose/v3 v3.27.2/go.mod h1:qWW+/8dkVtJYjJrbIpwD5xxnEJTUKvxkQ9JKQp9LaIM=
github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o=
github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg=
github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk=
github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE=
github.com/prometheus/common v0.69.0 h1:OA85nJQS/T/MaYh/Q2CcgDKSGWqNIgrBDvDH85CuiNk=
github.com/prometheus/common v0.69.0/go.mod h1:ZzL3f6u94qUxh9p+tJTrF+FvBS1XXbbRAZCQkytAL0Y=
github.com/prometheus/procfs v0.21.1 h1:GljZCt+zSTS+NZq88cyQ1LjZ+RCHp3uVuabBWA5+OJI=
github.com/prometheus/procfs v0.21.1/go.mod h1:aB55Cww9pdSJVHk0hUf0inxWyyjPogFIjmHKYgMKmtY=
github.com/pressly/goose/v3 v3.30.1 h1:KO28meBdbAUIdMbTP7bl9dp1FYZGXcYWb2O7miT09lE=
github.com/pressly/goose/v3 v3.30.1/go.mod h1:CHGwuG2acDerUaXwz2i5T18VSauXpYDiL4WxzDvcOIM=
github.com/prometheus/client_golang v1.25.0 h1:cDtW1TcFsMi1RJc8khwCKB4VhzwV04aKqbYtNOXuiK0=
github.com/prometheus/client_golang v1.25.0/go.mod h1:j2X/4/kaQHLPnmyEU8zjmkndo1T317VpCIQEml8LTKk=
github.com/prometheus/client_model v0.6.3 h1:O0jaTVAYNxTHYInEPFJt5I3+sN8zqBtVMPTB1qyxiEo=
github.com/prometheus/client_model v0.6.3/go.mod h1:gpN5P9S7Rr6Yr92PiQ+Ixvhf6JZEkF1dnxsYL2aPBEM=
github.com/prometheus/common v0.74.0 h1:6iYW8MsYvmEnXFD9zLGgF0qmReaRhs3OMONu1c/nrLI=
github.com/prometheus/common v0.74.0/go.mod h1:i/02C+FCst5B1etKgWesNrD49n+onplJCqUCtUKkOeA=
github.com/prometheus/procfs v0.23.0 h1:ad+S6FTkzwaMgacKLM5h6bNKExS+DMH0YiUwXItH/o4=
github.com/prometheus/procfs v0.23.0/go.mod h1:3AVXO0FqLafyYFU/V/IQRZlC8Rgqz8Dm/x6pKLK+RIk=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=
github.com/sethvargo/go-retry v0.3.0 h1:EEt31A35QhrcRZtrYFDTBg91cqZVnFL2navjDrah2SE=
github.com/sethvargo/go-retry v0.3.0/go.mod h1:mNX17F0C/HguQMyMyJxcnU471gOZGxCLyYaFyAZraas=
github.com/sethvargo/go-retry v0.5.0 h1:JYfFKmVJ8ER06GReN1efzc5cm52BrVsFVzmcHiKJwfY=
github.com/sethvargo/go-retry v0.5.0/go.mod h1:tvsjdKG6xfiCx4LSiUZ06kcv38xvdVQwv8R6/VnnVWg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
@@ -132,8 +126,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE=
github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg=
github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY=
github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
@@ -144,64 +138,66 @@ github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4=
github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
github.com/txix-open/bellows v1.2.0 h1:CXv8nQaZtB/micraeRilYyj/gtfv+bqBgP5aPYQgjeY=
github.com/txix-open/bellows v1.2.0/go.mod h1:qbKCy+RTgD30Qpw1fyb3y3jp5Y9mGhLLxgae1l0W92o=
github.com/txix-open/etp/v4 v4.1.1 h1:Yna+0mw/kQZP7Rl6QI4spCrO6qgO8ZhP8PjHlJj2lTU=
github.com/txix-open/etp/v4 v4.1.1/go.mod h1:9GK+Aje8BmLFq8Hk4j6Qb976LdU9WECCWAuLK1vAKgM=
github.com/txix-open/isp-kit v1.71.1 h1:MNSuHy/HEvy7dKPQXkM+dgQpShDhcv1Sq1kLgep2LaA=
github.com/txix-open/isp-kit v1.71.1/go.mod h1:j2sj86byoKllCs+DaRWwg56NgcL2omr/bUzmU7+AF74=
github.com/txix-open/validator/v10 v10.0.0-20250506161033-f8ce404fffdb h1:UJgT4u/QMv5QHKOQeJ7igShHa36c2/vIRqJiRLdDlf0=
github.com/txix-open/validator/v10 v10.0.0-20250506161033-f8ce404fffdb/go.mod h1:0biAFE0bgbcKeBBAwgEDhbZz6uT1vuSETCrFQlv2RiA=
github.com/txix-open/etp/v4 v4.1.3 h1:u9ZyU2yKGgoQ1/DSaElhazWm8xASdqGEdWjoJ2xQlfo=
github.com/txix-open/etp/v4 v4.1.3/go.mod h1:9GK+Aje8BmLFq8Hk4j6Qb976LdU9WECCWAuLK1vAKgM=
github.com/txix-open/isp-kit v1.76.0 h1:kqhX2DuoTfeW7BIshedG26TRIfOgX0QOInm606ssGVg=
github.com/txix-open/isp-kit v1.76.0/go.mod h1:hR9iAlh3x9gEg5GfALrrkN/2SbGkgZQCmwO2GZWjC1M=
github.com/txix-open/validator/v10 v10.0.0-20261027072444-85f3391fc5c3 h1:1jE11HLmMHDYYAcE+UmQ5VHgz4stzz0+daJbDWS+sEs=
github.com/txix-open/validator/v10 v10.0.0-20261027072444-85f3391fc5c3/go.mod h1:Yf41v210LFyYAj+tGmDh7PHdGsTaZjdBzHG0ptUvihw=
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.69.0 h1:MCcYL7J6Vt/X0kjqbMZkekCmwsurbQRbL69vkiye2lk=
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.69.0/go.mod h1:3jnStNwSufK+f5ktjL4EPcwtig4rtd81NS70lqHuXl8=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0 h1:8tvICD4vSTOOsNrsI4Ljf6C+6UKvpTEH5XY3JMoyPoo=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0/go.mod h1:z9+yiacE0IHRqM4qFfkbt/JYlmYXgss8GY/jXoNuPJI=
go.opentelemetry.io/otel v1.44.0 h1:JjwHmHpA4iZ3wBxluu2fbbE7j4kqlE8jXyAyPXH7HqU=
go.opentelemetry.io/otel v1.44.0/go.mod h1:BMgjTHL9WPRlRjL2oZCBTL4whCGtXch2H4BhOPIAyYc=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.44.0 h1:4YsVu3B8+3qtWYYrsUYgn0OG78pN0rnNPRGX4SbokQI=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.44.0/go.mod h1:+wnlSn0mD1ADVMe3v9Z/WIaiz6q6gL2J/ejaAmdmv80=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.44.0 h1:lgh3PiVrRUWMLOVSkQicxzZll5NjF1r+AtsX1XRIHw0=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.44.0/go.mod h1:5Cnhth3m/AgOeTgE3ex12pPmiu/gGtZit03kSzx9X7s=
go.opentelemetry.io/otel/metric v1.44.0 h1:1w0gILTcHdr3YI+ixLyjemwrVnsMURbTZFrSYCdDdmc=
go.opentelemetry.io/otel/metric v1.44.0/go.mod h1:8O7hanEPBNgEMmybD3s2VBKcgWOCsA6tzHBPODAiquo=
go.opentelemetry.io/otel/sdk v1.44.0 h1:nHYwb9lK+fJPU/dnT6s7W7Z8itMWyqrnVfbheVYrZ58=
go.opentelemetry.io/otel/sdk v1.44.0/go.mod h1:Osuydd3Se74nqjAKxid74N5eC+jfEqfTegHRnq58oK0=
go.opentelemetry.io/otel/sdk/metric v1.44.0 h1:3LlKgI+VjbVsjNRFZJZAJ30WjXC5VkNRks6si09iEfI=
go.opentelemetry.io/otel/sdk/metric v1.44.0/go.mod h1:5B5pMARnXxKhltooO4xUuCBorl65a4EpnTalObqOigA=
go.opentelemetry.io/otel/trace v1.44.0 h1:jxF5CsGYCe74MCRx2X4g7WsY/VBKRqqpNvXlX/6gtIk=
go.opentelemetry.io/otel/trace v1.44.0/go.mod h1:oLl1jrMQAVo6v3GAggN+1VH9VIz9iUSvW53sW1Q8PIE=
go.opentelemetry.io/proto/otlp v1.10.0 h1:IQRWgT5srOCYfiWnpqUYz9CVmbO8bFmKcwYxpuCSL2g=
go.opentelemetry.io/proto/otlp v1.10.0/go.mod h1:/CV4QoCR/S9yaPj8utp3lvQPoqMtxXdzn7ozvvozVqk=
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.72.0 h1:jva1c3z2ZFEQ5sTvnLG2tBALNehO+QvdXKQii6eKRoo=
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.72.0/go.mod h1:3pjFS5EnOVfjvYO6/NMdtJFHFQR+8uiGtrZ965nZP4w=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.72.0 h1:LxwW/9ctSCv+QkE/cLR7M91ZIkXNMqJtEMi1vCw9U8s=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.72.0/go.mod h1:tOsftB4SslBwwErVEPaenU2RpThXWPIU8DoJHEC4dyw=
go.opentelemetry.io/otel v1.47.0 h1:j7ALJ/zgkS7Z6aeJW09p8VC9804bC+PpeTfCD4XPnOM=
go.opentelemetry.io/otel v1.47.0/go.mod h1:8wS9O2qfXrYrzp6hIF/HOYJJf/wIhFPhR2xLuP+iXQU=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 h1:julhjPeUH/q/7hinbSdDdqt5h7Zw9YWmRlWRhI0jd54=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0/go.mod h1:Ao2mz688LH/tFf0yMAenidq6k2YNSx6SIY2q6jDACck=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 h1:aXZXsZ012wOgVkqaiQv+Z/d8V0xKjmg70F6m4CE94lc=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0/go.mod h1:ziu1gUIJhAaxM3EV1e3Ralk5AAyL1UOYz3lJJ4VSI38=
go.opentelemetry.io/otel/log v1.47.0 h1:cOTS1CcLbSQeZKanGJ+0JpF/+t4PELi3O3bbl2lqCcI=
go.opentelemetry.io/otel/log v1.47.0/go.mod h1:9byitSQ5pLC6PpqwGXjqdMKya6ZTswHRZh2vvXT33nw=
go.opentelemetry.io/otel/metric v1.47.0 h1:4PptaldXx3Eat1XjMZ68pPJEs5wrhlemctZE9a3UdWY=
go.opentelemetry.io/otel/metric v1.47.0/go.mod h1:ADGSXxRrXM6bjbvLo535EstVFlPpPYZm4LBKixjDHwU=
go.opentelemetry.io/otel/sdk v1.47.0 h1:zWXEr4j2lFefG87TU6Yg8a7ngfohIKFZHKp0Hf5hC6I=
go.opentelemetry.io/otel/sdk v1.47.0/go.mod h1:VUc24kiOeoGsxG8G9ULx3fWKvB7jMhnGE8Oi607lgR0=
go.opentelemetry.io/otel/sdk/metric v1.47.0 h1:lfISg2j93VT6yqdk9OfUaZmw/GfcZqCCV3jdXtsPnKw=
go.opentelemetry.io/otel/sdk/metric v1.47.0/go.mod h1:ypLp+mW1Nt2x+Szt3b5/i1syodyts49lMOwxpDI3VGw=
go.opentelemetry.io/otel/trace v1.47.0 h1:JOjX/Oci8K94QHddo+bbfya/Ai/nf6/dt9ZfrFNWSrM=
go.opentelemetry.io/otel/trace v1.47.0/go.mod h1:jNaSLa2PZEYFG6fRjJABAu+bw4FS08uDmPg28lTghu0=
go.opentelemetry.io/proto/otlp v1.11.1 h1:SCrPqH9NE5CmBrOqpjNCiT0X5mGwMyGERXdogfR7Yjw=
go.opentelemetry.io/proto/otlp v1.11.1/go.mod h1:wq8W4aSf6bOy8RZyESOeQFr9Pu7wydWX/TY4sgvrTPg=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.28.0 h1:IZzaP1Fv73/T/pBMLk4VutPl36uNC+OSUh3JLG3FIjo=
go.uber.org/zap v1.28.0/go.mod h1:rDLpOi171uODNm/mxFcuYWxDsqWSAVkFdX4XojSKg/Q=
go.yaml.in/yaml/v2 v2.4.4 h1:tuyd0P+2Ont/d6e2rl3be67goVK4R6deVxCUX5vyPaQ=
go.yaml.in/yaml/v2 v2.4.4/go.mod h1:gMZqIpDtDqOfM0uNfy0SkpRhvUryYH0Z6wdMYcacYXQ=
go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
golang.org/x/crypto v0.54.0 h1:YLIA59K4fiNzHzjnZt2tUJQjQtUWfWbeHBqKtk3eScw=
golang.org/x/crypto v0.54.0/go.mod h1:KWL8ny2AZdGR2cWmzeHrp2azQPGogOv+HeQaVEXC2dk=
golang.org/x/net v0.57.0 h1:K5+3DljvIuDG9/Jv9rvyMywYNFCQ9RSUY6OOTTkT+tE=
golang.org/x/net v0.57.0/go.mod h1:KpXc8iv+r3XplLAG/f7Jsf9RPszJzdR0f58q9vGOuEU=
golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek=
golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs=
golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/text v0.40.0 h1:Ub2Z6/xjgF1WrYQz2nuITOEegKFtiIy+rieRJ5lHZKs=
golang.org/x/text v0.40.0/go.mod h1:hpnzDAfGV753zIKo+wk3u1bVKCGPbrnF7+7LBF/UHVY=
go.yaml.in/yaml/v2 v2.4.5 h1:a5nxWvYi94DRl6QSLlTbLpVmutgx2qg8EVjnJtuFpwI=
go.yaml.in/yaml/v2 v2.4.5/go.mod h1:gMZqIpDtDqOfM0uNfy0SkpRhvUryYH0Z6wdMYcacYXQ=
go.yaml.in/yaml/v3 v3.0.6 h1:zcDfvjXEqTQmpjniUBLc91xYJMB2c4QOFxEF/LCEckM=
go.yaml.in/yaml/v3 v3.0.6/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg=
golang.org/x/crypto v0.59.0 h1:xS2jhqYbzNrpvkWP2YTDf4TJwBy3ykR03i8vFDxEc7c=
golang.org/x/crypto v0.59.0/go.mod h1:veDyUwATGs3c+vN3VfTbzViMGXeTBk3WyhBOkn+F/4U=
golang.org/x/net v0.63.0 h1:HCoTmNh9EpD1PpK8gBNFY4gcTY4N+KQEO8ylfIKqFJ0=
golang.org/x/net v0.63.0/go.mod h1:15JLg3IX1bLjHK264EZQEbIpTiR/KVLuo9CTRWd0pig=
golang.org/x/sync v0.25.0 h1:dJnifr0nMV8/SBnBvdo4eSGGnrc3O4FFx6IqvtLcmRs=
golang.org/x/sync v0.25.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0=
golang.org/x/sys v0.50.0 h1:dkKZEFTEKaLr1sjhs0WiKqoi8Jj5nHbS3Njmx1UoMJs=
golang.org/x/sys v0.50.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og=
golang.org/x/text v0.44.0 h1:YItdp/mQNGnsmrgpcdA5yQ3bnRxCfo/Tj/iByGW9GGo=
golang.org/x/text v0.44.0/go.mod h1:S4FR1waQ9LbjQTls97SyRjDaUUVkaM+cXwwuG/G+MwY=
gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4=
gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E=
google.golang.org/genproto/googleapis/api v0.0.0-20260630182238-925bb5da69e7 h1:jQ9p21COKWjP3VwuFrNRiiOTMh3mPpN45R7SLrH/HUU=
google.golang.org/genproto/googleapis/api v0.0.0-20260630182238-925bb5da69e7/go.mod h1:KqHwBx2upmfa1XSi1WuRvC+2VGCLtooKkfmyvRbUmqA=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260724162435-b2f20204f0df h1:O3ig1i5WDDzsVzRp+cCdgelT9vXnlnOFdlEeFtL4HCc=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260724162435-b2f20204f0df/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8=
google.golang.org/grpc v1.82.1 h1:NnAxzGRA0677vCa4BUkOAnO5+FfQqVl9iUXeD0IqcGE=
google.golang.org/grpc v1.82.1/go.mod h1:yzTZ1TB1Z3SG+LIYaI+WiE8D5+PZ3ArnrSp8zF3+/ZA=
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
google.golang.org/genproto/googleapis/api v0.0.0-20261118221215-c8830f628b3f h1:7CbYDSDM5xqpq8v2tNm+Q057COf1lvA0gorVk+304tY=
google.golang.org/genproto/googleapis/api v0.0.0-20261118221215-c8830f628b3f/go.mod h1:CPxXEEQ1S9iJmInAF/8MNc8tKWnya8I8Kni9Zh2hV0M=
google.golang.org/genproto/googleapis/rpc v0.0.0-20261118221215-c8830f628b3f h1:aDW6Vb2T1K0xbAgW+ED8iz39WlgjjX/OKiNh6tXv/+g=
google.golang.org/genproto/googleapis/rpc v0.0.0-20261118221215-c8830f628b3f/go.mod h1:OaIUM3+LpYcK2GXM4FTmhWoIq371Owdr+Cc7/BsYHHc=
google.golang.org/grpc v1.85.0 h1:BPBCfuVRQ1qvBhKDOq9uvQllMvO59rKsYhXpp7Dd8vw=
google.golang.org/grpc v1.85.0/go.mod h1:0rQrOD58yjal/0EaVbGBANindixsCZNQPDV3VKtaKuQ=
google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc=
google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
@@ -210,11 +206,11 @@ gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYs
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
modernc.org/libc v1.73.4 h1:+ra4Ui8ngyt8HDcO1FTDPWlkAh6yOdaO2yAoh8MddQA=
modernc.org/libc v1.73.4/go.mod h1:DXZ3eO8qMCNn2SnmTNCiC71nJ9Rcq3PsnpU6Vc4rWK8=
modernc.org/libc v1.80.2 h1:3+a4fJZvvzg920ZC0mOepnKPGn7cqCaVeDxm/UnrM1A=
modernc.org/libc v1.80.2/go.mod h1:pvo25Rs3OJEbDqhUV9jdEGevxeLJrJeDmNid/AcQV1g=
modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU=
modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg=
modernc.org/memory v1.11.0 h1:o4QC8aMQzmcwCK3t3Ux/ZHmwFPzE6hf2Y5LbkRs+hbI=
modernc.org/memory v1.11.0/go.mod h1:/JP4VbVC+K5sU2wZi9bHoq2MAkCnrt2r98UGeSK7Mjw=
modernc.org/sqlite v1.53.0 h1:20WG8N9q4ji/dEqGk4uiI0c6OPjSeLTNYGFCc3+7c1M=
modernc.org/sqlite v1.53.0/go.mod h1:xoEpOIpGrgT48H5iiyt/YXPCZPEzlfmfFwtk8Lklw8s=
modernc.org/memory v1.12.1 h1:nFMiWrpStgZczNl6XI9GnIk/rWhYIyHGUaR04pGbp9g=
modernc.org/memory v1.12.1/go.mod h1:/JP4VbVC+K5sU2wZi9bHoq2MAkCnrt2r98UGeSK7Mjw=
modernc.org/sqlite v1.62.0 h1:gMaCjSM1qpl+iOjiWhR1LYP3zqrYDI+5GYLGt6veP2g=
modernc.org/sqlite v1.62.0/go.mod h1:Jzjh1mt4s0HuQ0KvtB1LIuHiGRmU2D5pgj8dUhW7/SE=
+1 -1
View File
@@ -11,7 +11,7 @@ type Local struct {
ConfigServiceAddress bootstrap.ConfigServiceAddr
MaintenanceMode bool
Credentials []auth.Credential
KeepConfigVersions int `validate:"required"`
KeepConfigVersions int
InternalClientCredential string `validate:"required"`
Rqlite Rqlite
Backup rqlite.Backup
+2
View File
@@ -68,6 +68,8 @@ definitions:
type: string
id:
type: string
isModuleLeader:
type: boolean
libVersion:
type: string
moduleName:
+9 -8
View File
@@ -28,14 +28,15 @@ type ModuleInfo struct {
}
type Connection struct {
Id string
ModuleName string
LibVersion string
Version string
Address Address
Transport string
Endpoints []EndpointDescriptor
EstablishedAt time.Time
Id string
ModuleName string
LibVersion string
Version string
Address Address
IsModuleLeader bool
Transport string
Endpoints []EndpointDescriptor
EstablishedAt time.Time
}
type Address struct {
+1
View File
@@ -14,6 +14,7 @@ type Backend struct {
LibVersion string `json:"lib_version"`
ModuleName string `json:"module_name"`
Transport string `json:"transport"`
ModuleLeaderMode string `json:"module_leader_mode"`
ConfigServiceNodeId string `json:"config_service_node_id"`
Endpoints xtypes.Json[[]cluster.EndpointDescriptor] `json:"endpoints"`
RequiredModules xtypes.Json[[]cluster.ModuleDependency] `json:"required_modules"`
+37 -35
View File
@@ -1,6 +1,6 @@
module isp-config-service
go 1.26.0
go 1.27
replace (
github.com/armon/go-metrics => github.com/hashicorp/go-metrics v0.5.1
@@ -10,8 +10,8 @@ replace (
require (
github.com/Masterminds/squirrel v1.5.4
github.com/google/uuid v1.6.0
github.com/pressly/goose/v3 v3.27.3
github.com/prometheus/client_golang v1.24.1
github.com/pressly/goose/v3 v3.30.1
github.com/prometheus/client_golang v1.25.0
github.com/rqlite/gorqlite v0.0.0-20250609141355-ac86a4a1c9a8
github.com/rqlite/rqlite-disco-clients v0.0.0-20250205044118-8ada2b350099
github.com/rqlite/rqlite/v10 v10.2.7
@@ -19,10 +19,10 @@ require (
github.com/tidwall/gjson v1.18.0
github.com/txix-open/etp/v4 v4.1.3
github.com/txix-open/go-cmp v0.0.0-20240401171944-16b203530f60
github.com/txix-open/isp-kit v1.74.1
github.com/txix-open/isp-kit v1.76.0
github.com/xeipuuv/gojsonschema v1.2.0
golang.org/x/sync v0.22.0
google.golang.org/grpc v1.83.2
golang.org/x/sync v0.25.0
google.golang.org/grpc v1.85.0
)
require (
@@ -53,14 +53,14 @@ require (
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/coder/websocket v1.8.15 // indirect
github.com/fatih/color v1.19.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.15 // indirect
github.com/getsentry/sentry-go v0.49.0 // indirect
github.com/go-faker/faker/v4 v4.11.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.16 // indirect
github.com/getsentry/sentry-go v0.50.0 // indirect
github.com/go-faker/faker/v4 v4.12.0 // indirect
github.com/go-logr/logr v1.4.4 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect
github.com/go-playground/locales v0.14.2 // indirect
github.com/go-playground/universal-translator v0.18.2 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.34.0 // indirect
github.com/hashicorp/go-hclog v1.6.3 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-metrics v0.6.0 // indirect
@@ -70,52 +70,54 @@ require (
github.com/hashicorp/golang-lru v1.0.2 // indirect
github.com/hashicorp/raft v1.7.3 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.19.2 // indirect
github.com/klauspost/compress v1.20.4 // indirect
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
github.com/leodido/go-urn v1.5.0 // indirect
github.com/mailru/easyjson v0.9.2 // indirect
github.com/mattn/go-colorable v0.1.15 // indirect
github.com/mattn/go-isatty v0.0.23 // indirect
github.com/mattn/go-isatty v0.0.24 // indirect
github.com/mattn/go-sqlite3 v1.14.47 // indirect
github.com/mfridman/interpolate v0.0.2 // indirect
github.com/mfridman/interpolate v0.2.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/common v0.70.1 // indirect
github.com/prometheus/procfs v0.21.1 // indirect
github.com/pandatix/go-abnf v0.5.5 // indirect
github.com/prometheus/client_model v0.6.3 // indirect
github.com/prometheus/common v0.74.0 // indirect
github.com/prometheus/procfs v0.23.0 // indirect
github.com/rqlite/raft-boltdb/v2 v2.0.0-20230523104317-c08e70f4de48 // indirect
github.com/rqlite/sql v0.0.0-20260224021119-1b2524a41372 // indirect
github.com/sethvargo/go-retry v0.4.0 // indirect
github.com/sethvargo/go-retry v0.5.0 // indirect
github.com/tidwall/match v1.2.0 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
github.com/txix-open/bellows v1.2.0 // indirect
github.com/txix-open/jsonschema v1.3.0 // indirect
github.com/txix-open/validator/v10 v10.0.0-20250506161033-f8ce404fffdb // indirect
github.com/txix-open/validator/v10 v10.0.0-20261027072444-85f3391fc5c3 // indirect
github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
go.etcd.io/bbolt v1.5.0 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.71.0 // indirect
go.opentelemetry.io/otel v1.46.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.46.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.46.0 // indirect
go.opentelemetry.io/otel/metric v1.46.0 // indirect
go.opentelemetry.io/otel/sdk v1.46.0 // indirect
go.opentelemetry.io/otel/trace v1.46.0 // indirect
go.opentelemetry.io/proto/otlp v1.11.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.72.0 // indirect
go.opentelemetry.io/otel v1.47.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect
go.opentelemetry.io/otel/log v1.47.0 // indirect
go.opentelemetry.io/otel/metric v1.47.0 // indirect
go.opentelemetry.io/otel/sdk v1.47.0 // indirect
go.opentelemetry.io/otel/trace v1.47.0 // indirect
go.opentelemetry.io/proto/otlp v1.11.1 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.28.0 // indirect
go.yaml.in/yaml/v3 v3.0.5 // indirect
golang.org/x/crypto v0.55.0 // indirect
golang.org/x/net v0.58.0 // indirect
golang.org/x/sys v0.47.0 // indirect
golang.org/x/text v0.41.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20260825221802-da73d73af1c5 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260825221802-da73d73af1c5 // indirect
go.yaml.in/yaml/v3 v3.0.6 // indirect
golang.org/x/crypto v0.59.0 // indirect
golang.org/x/net v0.63.0 // indirect
golang.org/x/sys v0.50.0 // indirect
golang.org/x/text v0.44.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20261118221215-c8830f628b3f // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20261118221215-c8830f628b3f // indirect
google.golang.org/protobuf v1.36.12 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
+90 -88
View File
@@ -65,21 +65,21 @@ github.com/coder/websocket v1.8.15 h1:6B2JPeOGlpff2Uz6vOEH1Vzpi0iUz20A+lPVhPHtNU
github.com/coder/websocket v1.8.15/go.mod h1:NX3SzP+inril6yawo5CQXx8+fk145lPDC6pumgx0mVg=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/dustin/go-humanize v1.1.0 h1:dbKTrvD0klcbBV/h4AWJdMuZogJACoMlvWIWZ5b2xWg=
github.com/dustin/go-humanize v1.1.0/go.mod h1:hc1CvRkJMsgxqjmjMQF3QNRAZBwY8AXBAzKYoSX9sFI=
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
github.com/fatih/color v1.19.0 h1:Zp3PiM21/9Ld6FzSKyL5c/BULoe/ONr9KlbYVOfG8+w=
github.com/fatih/color v1.19.0/go.mod h1:zNk67I0ZUT1bEGsSGyCZYZNrHuTkJJB+r6Q9VuMi0LE=
github.com/felixge/httpsnoop v1.1.0 h1:3YtUj32ZZkqZtt3sZZsClsymw/QDuVfpNhoA31zeORc=
github.com/felixge/httpsnoop v1.1.0/go.mod h1:Zqxgdd+1Rkcz8euOqdr7lqgCRJztwr5hp9vDSi5UZCE=
github.com/gabriel-vasile/mimetype v1.4.15 h1:05iP/CYtZ/w455R/KZM6rZ5ieAdh99UPtd+d3YzLmaI=
github.com/gabriel-vasile/mimetype v1.4.15/go.mod h1:azpTcoLcDZRNgFou5j+APrqQx9HqVPWa6ijYQIIVswQ=
github.com/getsentry/sentry-go v0.49.0 h1:Ehejknu1l023Ub7QoRBVLAI7g3Jnhqku4oWx4B4Sh5s=
github.com/getsentry/sentry-go v0.49.0/go.mod h1:nuMJAoCfe1u0Bts2ocyNI+TW8HT84vRMqwA5Qq/SKUI=
github.com/gabriel-vasile/mimetype v1.4.16 h1:5izNFuvA37st1dDRAcA7TtmngBmRgiIPDmTtiEvjx1E=
github.com/gabriel-vasile/mimetype v1.4.16/go.mod h1:3oFFwxX8kTklZwzIl2aQEDZT0lKY8xH92ST88bAwba4=
github.com/getsentry/sentry-go v0.50.0 h1:gkO59rn/i0RCAXUUTflC5QVbTQGPXbaFabs2olVzc9g=
github.com/getsentry/sentry-go v0.50.0/go.mod h1:+xsDuN+SoRN/xfs1hdq78wnrE3omIZf+FCuh9FOW1C8=
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=
github.com/go-faker/faker/v4 v4.11.0 h1:HeIFTzafXsgrlxKE2QySGGTQocfGdQ8sGqU2CXvs120=
github.com/go-faker/faker/v4 v4.11.0/go.mod h1:VFIEwWDd16EdYDLF6NJ5gAAzEp7vz5LgKgJ2iZ17Tdg=
github.com/go-faker/faker/v4 v4.12.0 h1:yZXxuoQjxN+C2PVgYoDSHGiD9wj6dX1/Ful4p7QQV0k=
github.com/go-faker/faker/v4 v4.12.0/go.mod h1:VFIEwWDd16EdYDLF6NJ5gAAzEp7vz5LgKgJ2iZ17Tdg=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
@@ -91,12 +91,10 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
github.com/go-resty/resty/v2 v2.17.2 h1:FQW5oHYcIlkCNrMD2lloGScxcHJ0gkjshV3qcQAyHQk=
github.com/go-resty/resty/v2 v2.17.2/go.mod h1:kCKZ3wWmwJaNc7S29BRtUhJwy7iqmn+2mLtQrOyQlVA=
github.com/go-playground/locales v0.14.2 h1:d8UmcrM6Nip0hfGZKLGpAvZH37XB4TS0xzK9B56YNCY=
github.com/go-playground/locales v0.14.2/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
github.com/go-playground/universal-translator v0.18.2 h1:LCsMLC9RzmbUMNUPVYD15dmcjwYAJhmX8mPZRW4rAVU=
github.com/go-playground/universal-translator v0.18.2/go.mod h1:67VZIMp5lQpDWlnStOct22q1bkdJGJqHghbOtmkawxk=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM=
github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE=
@@ -113,8 +111,8 @@ github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 h1:/Tnpcb2E0Pz/tN9s3bfEY2Q8ePCEX9iuS+cneUwncnw=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0/go.mod h1:zOBXOsUaBSjKgmH4OGzV1esUpR3oUSCPYVd2cUBjKYY=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.34.0 h1:vzlTzzi4tHLa/JQdIE5LeXw6SEX5EVVhq/VPqKHnKOk=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.34.0/go.mod h1:FHXQZnW5pA0txiMr3jApv9uNJzZ+7mYZd+u+PPenCFU=
github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
github.com/hashicorp/go-hclog v0.9.1/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k=
@@ -149,8 +147,8 @@ github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHm
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U=
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
github.com/klauspost/compress v1.19.2 h1:hMRETovs/pu/dVWN7zIT1PGG8t509MwT6bO7XSi26R8=
github.com/klauspost/compress v1.19.2/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ=
github.com/klauspost/compress v1.20.4 h1:dD0v/bvxtjCBqQu6sx1TNWkalEY5lNTIe+HY9w8TeNI=
github.com/klauspost/compress v1.20.4/go.mod h1:LUdAzn7YLVvxLpc7y3V1m40wESHTgc1422pwwBSKYuI=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
@@ -176,11 +174,11 @@ github.com/mattn/go-colorable v0.1.15 h1:+u9SLTRGnXv73cEsnsmoZBom+dMU88B2M0aDcWy
github.com/mattn/go-colorable v0.1.15/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
github.com/mattn/go-isatty v0.0.23 h1:cYwCQTQf3HB6xUC+BtyCLZNr7IzbOmoZbmssVNzSyiQ=
github.com/mattn/go-isatty v0.0.23/go.mod h1:nMCL3Zebbrt45jsMDgnfIwz6ydEQApk5oEI3HqDio6A=
github.com/mattn/go-isatty v0.0.24 h1:tGZZoVgT/KiqK1c8ocVLeDS8BSWMRd47J3Lbz7vsReI=
github.com/mattn/go-isatty v0.0.24/go.mod h1:nMCL3Zebbrt45jsMDgnfIwz6ydEQApk5oEI3HqDio6A=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/mfridman/interpolate v0.0.2 h1:pnuTK7MQIxxFz1Gr+rjSIx9u7qVjf5VOoM/u6BbAxPY=
github.com/mfridman/interpolate v0.0.2/go.mod h1:p+7uk6oE07mpE/Ik1b8EckO0O4ZXiGAfshKBWLUM9Xg=
github.com/mfridman/interpolate v0.2.0 h1:HM9ID8p6CUxoMJX+fECOtGQ2Mu7TW/GIMPyu48nnvUg=
github.com/mfridman/interpolate v0.2.0/go.mod h1:8SfDy95IaPNnIokZh9mvIppmc3fGl8fx+Gu7uusuO9Q=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -193,8 +191,10 @@ github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjY
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/ncruces/go-strftime v1.0.0 h1:HMFp8mLCTPp341M/ZnA4qaf7ZlsbTc+miZjCLOFAw7w=
github.com/ncruces/go-strftime v1.0.0/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls=
github.com/ncruces/go-strftime v1.1.0 h1:vtPmPWMkb539RGV9WpWT9EwJGvrOCKvMNI4obWL47Hk=
github.com/ncruces/go-strftime v1.1.0/go.mod h1:yVaq7iwCN09vHRrKBrrflXT0M9tTMG2KmZ9Fj7xeG/g=
github.com/pandatix/go-abnf v0.5.5 h1:EXex5KkRQx4Dm6GnpAcQnIMBs9KiK0uf8p/wq+4t9PM=
github.com/pandatix/go-abnf v0.5.5/go.mod h1:AE0KD3/VNoCjGzc1gqetRKshbI4SYErXQ/8kPenR5mc=
github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY=
github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4=
@@ -204,29 +204,29 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pressly/goose/v3 v3.27.3 h1:pIglVHjw99r4e/hDHHwbl9vfOsDMqUokfkXo6+n/RxA=
github.com/pressly/goose/v3 v3.27.3/go.mod h1:Dag+xpV6o20HR2LFY1j0q6MDwc3f7vPUFDA77R+0yGY=
github.com/pressly/goose/v3 v3.30.1 h1:KO28meBdbAUIdMbTP7bl9dp1FYZGXcYWb2O7miT09lE=
github.com/pressly/goose/v3 v3.30.1/go.mod h1:CHGwuG2acDerUaXwz2i5T18VSauXpYDiL4WxzDvcOIM=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU=
github.com/prometheus/client_golang v1.24.1 h1:JnJkREXzWxUdCuPFpIWZiPispT9xVV59uiuyR2bPlnU=
github.com/prometheus/client_golang v1.24.1/go.mod h1:F+oSRECHg4sse5ucfYpYDeIv/hu68Zo0uoHKetWnzcE=
github.com/prometheus/client_golang v1.25.0 h1:cDtW1TcFsMi1RJc8khwCKB4VhzwV04aKqbYtNOXuiK0=
github.com/prometheus/client_golang v1.25.0/go.mod h1:j2X/4/kaQHLPnmyEU8zjmkndo1T317VpCIQEml8LTKk=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk=
github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE=
github.com/prometheus/client_model v0.6.3 h1:O0jaTVAYNxTHYInEPFJt5I3+sN8zqBtVMPTB1qyxiEo=
github.com/prometheus/client_model v0.6.3/go.mod h1:gpN5P9S7Rr6Yr92PiQ+Ixvhf6JZEkF1dnxsYL2aPBEM=
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4=
github.com/prometheus/common v0.70.1 h1:1HvjP4D5oL3t8RsPlwxA9onvvStjtIHYE5XuuwOi/PY=
github.com/prometheus/common v0.70.1/go.mod h1:VdFUQDMZK3VLkurFUVhia6uys/0suUp86TJz5qbJRhc=
github.com/prometheus/common v0.74.0 h1:6iYW8MsYvmEnXFD9zLGgF0qmReaRhs3OMONu1c/nrLI=
github.com/prometheus/common v0.74.0/go.mod h1:i/02C+FCst5B1etKgWesNrD49n+onplJCqUCtUKkOeA=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
github.com/prometheus/procfs v0.21.1 h1:GljZCt+zSTS+NZq88cyQ1LjZ+RCHp3uVuabBWA5+OJI=
github.com/prometheus/procfs v0.21.1/go.mod h1:aB55Cww9pdSJVHk0hUf0inxWyyjPogFIjmHKYgMKmtY=
github.com/rabbitmq/amqp091-go v1.14.0 h1:RSaT7aOKt/OrkVUyswPDW29lnRz9psuGmfZFBmLqLek=
github.com/rabbitmq/amqp091-go v1.14.0/go.mod h1:Hy4jKW5kQART1u+JkDTF9YYOQUHXqMuhrgxOEeS7G4o=
github.com/prometheus/procfs v0.23.0 h1:ad+S6FTkzwaMgacKLM5h6bNKExS+DMH0YiUwXItH/o4=
github.com/prometheus/procfs v0.23.0/go.mod h1:3AVXO0FqLafyYFU/V/IQRZlC8Rgqz8Dm/x6pKLK+RIk=
github.com/rabbitmq/amqp091-go v1.17.0 h1:6KmTqrnJq93cGIE3Q3UnXgsqw6NtLu8MNfFoIbfBAIQ=
github.com/rabbitmq/amqp091-go v1.17.0/go.mod h1:Hy4jKW5kQART1u+JkDTF9YYOQUHXqMuhrgxOEeS7G4o=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
@@ -243,8 +243,8 @@ github.com/rqlite/rqlite/v10 v10.2.7 h1:fUsbbgoELw+MrKfQ9EkVrm8tA0rdVUe/bYYdtOOs
github.com/rqlite/rqlite/v10 v10.2.7/go.mod h1:iTG1rLhR0zBBWTHiN33b9o/HXVwaC71xrcdoFaUJecE=
github.com/rqlite/sql v0.0.0-20260224021119-1b2524a41372 h1:2V0y6mzmPj7vQKad76nTL7sZ/lFLj5VKvNjpa6IRxYE=
github.com/rqlite/sql v0.0.0-20260224021119-1b2524a41372/go.mod h1:ib9zVtNgRKiGuoMyUqqL5aNpk+r+++YlyiVIkclVqPg=
github.com/sethvargo/go-retry v0.4.0 h1:9qy1OoIAxBL+gBYnkTnTnWle5wlfsXQlwRzIbbpdqPw=
github.com/sethvargo/go-retry v0.4.0/go.mod h1:tvsjdKG6xfiCx4LSiUZ06kcv38xvdVQwv8R6/VnnVWg=
github.com/sethvargo/go-retry v0.5.0 h1:JYfFKmVJ8ER06GReN1efzc5cm52BrVsFVzmcHiKJwfY=
github.com/sethvargo/go-retry v0.5.0/go.mod h1:tvsjdKG6xfiCx4LSiUZ06kcv38xvdVQwv8R6/VnnVWg=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
@@ -279,12 +279,12 @@ github.com/txix-open/go-cmp v0.0.0-20240401171944-16b203530f60 h1:7SZ72lNU69g8ei
github.com/txix-open/go-cmp v0.0.0-20240401171944-16b203530f60/go.mod h1:jzpq0uwcdGq0OSNXZ6vv6UJkCOU/fLPgeoz+KkGDYgo=
github.com/txix-open/grmq v1.12.0 h1:lSPYvwLfTL0+b0xDQmuuN6RaKS3NCEJNK9ccWpOWa8Y=
github.com/txix-open/grmq v1.12.0/go.mod h1:6m9CCTQao/HAFalu5rFOZGJ5KLEP6WzzIwj80Ml3KGE=
github.com/txix-open/isp-kit v1.74.1 h1:2WQl1+e6E1TXcgkm554kYpiyORgZiyJa/zQIks4cUCw=
github.com/txix-open/isp-kit v1.74.1/go.mod h1:i4g+hgfVQAXa02kHqr104TqYEsiW2em17RZF0KjkB78=
github.com/txix-open/isp-kit v1.76.0 h1:kqhX2DuoTfeW7BIshedG26TRIfOgX0QOInm606ssGVg=
github.com/txix-open/isp-kit v1.76.0/go.mod h1:hR9iAlh3x9gEg5GfALrrkN/2SbGkgZQCmwO2GZWjC1M=
github.com/txix-open/jsonschema v1.3.0 h1:XGuOTg22G7PdqfKypjajM20/i5FyGfFYsJKmheebKi4=
github.com/txix-open/jsonschema v1.3.0/go.mod h1:l8YDZ1nvJrw6uxWowSVOxCV/ebiMJyapffW87ZEqH00=
github.com/txix-open/validator/v10 v10.0.0-20250506161033-f8ce404fffdb h1:UJgT4u/QMv5QHKOQeJ7igShHa36c2/vIRqJiRLdDlf0=
github.com/txix-open/validator/v10 v10.0.0-20250506161033-f8ce404fffdb/go.mod h1:0biAFE0bgbcKeBBAwgEDhbZz6uT1vuSETCrFQlv2RiA=
github.com/txix-open/validator/v10 v10.0.0-20261027072444-85f3391fc5c3 h1:1jE11HLmMHDYYAcE+UmQ5VHgz4stzz0+daJbDWS+sEs=
github.com/txix-open/validator/v10 v10.0.0-20261027072444-85f3391fc5c3/go.mod h1:Yf41v210LFyYAj+tGmDh7PHdGsTaZjdBzHG0ptUvihw=
github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/fJgbpc=
github.com/wk8/go-ordered-map/v2 v2.1.8/go.mod h1:5nJHM5DyteebpVlHnWMV0rPz6Zp7+xBAnxjb1X5vnTw=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
@@ -299,51 +299,53 @@ go.etcd.io/bbolt v1.5.0 h1:S7GAl7Fxv12yohbwFfIbQCGDWbQbtDGPET4P/bD4lxU=
go.etcd.io/bbolt v1.5.0/go.mod h1:mkltfYE5aUHQxUct9N9V+Kp7aSjFqjgrhcXIS70Lrdk=
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.71.0 h1:oFNJW32h2SXnET7XXstgT7pVh4vN+jW+GfiIaBguIZE=
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.71.0/go.mod h1:+H3sPOFwag14eMHTPMElZtV0e4YfVZ/85KgrKUCB5FI=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.71.0 h1:3g7B90UzBltIDKq1/5mrTGxTnOFDV0ICOhLoxiZ8jlg=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.71.0/go.mod h1:Ef8SuTh59BT7+ofpDxN9z+yOlc4t2GjLmKDgYNJL/NU=
go.opentelemetry.io/otel v1.46.0 h1:FHt5/CDyVxi/8IM1CH7VE/rRgq3kLHa2mSTVMO8AWyc=
go.opentelemetry.io/otel v1.46.0/go.mod h1:Gj3SEScelsNC45tp4nSxRYlS+f5iez7W8XPMCt905kE=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.46.0 h1:OFnwLJr+pF3iHrlGSzbxyuo6/6HyBlnlN1CWEJmBVcw=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.46.0/go.mod h1:716wFneO0ov19A2beH5hjfh9AK5z/VWNAtDijp1Y0/g=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.46.0 h1:KrC1YrQeSt46ITMWAbgQx1M1eV1/1TKzttrBzymPmss=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.46.0/go.mod h1:zDSEzoEqsOrgBeGvH66KRgxh90VonFyJqBHA0Pk3+rM=
go.opentelemetry.io/otel/metric v1.46.0 h1:yBnkXvgV7AXFILZc5K6IZe/CBFF3OS7BJ8ov6/lj0K8=
go.opentelemetry.io/otel/metric v1.46.0/go.mod h1:iPmdWqifKUdzziPkvvzIJXITl56fQx2mGM/DHLB3/2o=
go.opentelemetry.io/otel/sdk v1.46.0 h1:h5CNQQjEbuQXY/JfZtgt3i7HVFV3aHPO2OAwO2eTYPI=
go.opentelemetry.io/otel/sdk v1.46.0/go.mod h1:GAERFXFt5SYCEB+YiKUbMBeza6UaDH7GmGOZEfh2gSM=
go.opentelemetry.io/otel/sdk/metric v1.46.0 h1:0piZ26EG4RBfebb2jhDH6ERCYHoVWduc3kLgPCwSnSE=
go.opentelemetry.io/otel/sdk/metric v1.46.0/go.mod h1:I1PbKrdVc8Qu8HYVDNtqVIwLwjNrhsV/uFuxfwg8mO4=
go.opentelemetry.io/otel/trace v1.46.0 h1:OULy7ccdJnZtJ0UDYFOIGaCmiWzJ8Vi2G/Rsu60qs1c=
go.opentelemetry.io/otel/trace v1.46.0/go.mod h1:J7GAXweO77XSFkB/rmAqk9D6ihszhFjLU+d9WuUxDLI=
go.opentelemetry.io/proto/otlp v1.11.0 h1:5rrYs0Ykyj50sdU/JU0x8etU+LubXWb+gED6TbEdMIk=
go.opentelemetry.io/proto/otlp v1.11.0/go.mod h1:SmVizdCOAm3XBtG1g1NnOdhW6jtddT72hLMhv8VwA8E=
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.72.0 h1:jva1c3z2ZFEQ5sTvnLG2tBALNehO+QvdXKQii6eKRoo=
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.72.0/go.mod h1:3pjFS5EnOVfjvYO6/NMdtJFHFQR+8uiGtrZ965nZP4w=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.72.0 h1:LxwW/9ctSCv+QkE/cLR7M91ZIkXNMqJtEMi1vCw9U8s=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.72.0/go.mod h1:tOsftB4SslBwwErVEPaenU2RpThXWPIU8DoJHEC4dyw=
go.opentelemetry.io/otel v1.47.0 h1:j7ALJ/zgkS7Z6aeJW09p8VC9804bC+PpeTfCD4XPnOM=
go.opentelemetry.io/otel v1.47.0/go.mod h1:8wS9O2qfXrYrzp6hIF/HOYJJf/wIhFPhR2xLuP+iXQU=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 h1:julhjPeUH/q/7hinbSdDdqt5h7Zw9YWmRlWRhI0jd54=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0/go.mod h1:Ao2mz688LH/tFf0yMAenidq6k2YNSx6SIY2q6jDACck=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 h1:aXZXsZ012wOgVkqaiQv+Z/d8V0xKjmg70F6m4CE94lc=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0/go.mod h1:ziu1gUIJhAaxM3EV1e3Ralk5AAyL1UOYz3lJJ4VSI38=
go.opentelemetry.io/otel/log v1.47.0 h1:cOTS1CcLbSQeZKanGJ+0JpF/+t4PELi3O3bbl2lqCcI=
go.opentelemetry.io/otel/log v1.47.0/go.mod h1:9byitSQ5pLC6PpqwGXjqdMKya6ZTswHRZh2vvXT33nw=
go.opentelemetry.io/otel/metric v1.47.0 h1:4PptaldXx3Eat1XjMZ68pPJEs5wrhlemctZE9a3UdWY=
go.opentelemetry.io/otel/metric v1.47.0/go.mod h1:ADGSXxRrXM6bjbvLo535EstVFlPpPYZm4LBKixjDHwU=
go.opentelemetry.io/otel/sdk v1.47.0 h1:zWXEr4j2lFefG87TU6Yg8a7ngfohIKFZHKp0Hf5hC6I=
go.opentelemetry.io/otel/sdk v1.47.0/go.mod h1:VUc24kiOeoGsxG8G9ULx3fWKvB7jMhnGE8Oi607lgR0=
go.opentelemetry.io/otel/sdk/metric v1.47.0 h1:lfISg2j93VT6yqdk9OfUaZmw/GfcZqCCV3jdXtsPnKw=
go.opentelemetry.io/otel/sdk/metric v1.47.0/go.mod h1:ypLp+mW1Nt2x+Szt3b5/i1syodyts49lMOwxpDI3VGw=
go.opentelemetry.io/otel/trace v1.47.0 h1:JOjX/Oci8K94QHddo+bbfya/Ai/nf6/dt9ZfrFNWSrM=
go.opentelemetry.io/otel/trace v1.47.0/go.mod h1:jNaSLa2PZEYFG6fRjJABAu+bw4FS08uDmPg28lTghu0=
go.opentelemetry.io/proto/otlp v1.11.1 h1:SCrPqH9NE5CmBrOqpjNCiT0X5mGwMyGERXdogfR7Yjw=
go.opentelemetry.io/proto/otlp v1.11.1/go.mod h1:wq8W4aSf6bOy8RZyESOeQFr9Pu7wydWX/TY4sgvrTPg=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.28.0 h1:IZzaP1Fv73/T/pBMLk4VutPl36uNC+OSUh3JLG3FIjo=
go.uber.org/zap v1.28.0/go.mod h1:rDLpOi171uODNm/mxFcuYWxDsqWSAVkFdX4XojSKg/Q=
go.yaml.in/yaml/v2 v2.4.4 h1:tuyd0P+2Ont/d6e2rl3be67goVK4R6deVxCUX5vyPaQ=
go.yaml.in/yaml/v2 v2.4.4/go.mod h1:gMZqIpDtDqOfM0uNfy0SkpRhvUryYH0Z6wdMYcacYXQ=
go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw=
go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg=
go.yaml.in/yaml/v2 v2.4.5 h1:a5nxWvYi94DRl6QSLlTbLpVmutgx2qg8EVjnJtuFpwI=
go.yaml.in/yaml/v2 v2.4.5/go.mod h1:gMZqIpDtDqOfM0uNfy0SkpRhvUryYH0Z6wdMYcacYXQ=
go.yaml.in/yaml/v3 v3.0.6 h1:zcDfvjXEqTQmpjniUBLc91xYJMB2c4QOFxEF/LCEckM=
go.yaml.in/yaml/v3 v3.0.6/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.55.0 h1:+KWHjbgOaAQ66dh/YlkZKHlz9ZUlq61AFirAR9ntP8M=
golang.org/x/crypto v0.55.0/go.mod h1:uq0V9dE/fzQuJtbnL+2EhWOE63vo164FY8xqEnV9xis=
golang.org/x/crypto v0.59.0 h1:xS2jhqYbzNrpvkWP2YTDf4TJwBy3ykR03i8vFDxEc7c=
golang.org/x/crypto v0.59.0/go.mod h1:veDyUwATGs3c+vN3VfTbzViMGXeTBk3WyhBOkn+F/4U=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.58.0 h1:ynWG7rqYi4ccpTEuPZ2QGWHktVEM9DMCj9yzDE0Q7To=
golang.org/x/net v0.58.0/go.mod h1:YwCddHnFlT7eLQqVprV19OnhLGtc5xOKgE0RyqgfWAU=
golang.org/x/net v0.63.0 h1:HCoTmNh9EpD1PpK8gBNFY4gcTY4N+KQEO8ylfIKqFJ0=
golang.org/x/net v0.63.0/go.mod h1:15JLg3IX1bLjHK264EZQEbIpTiR/KVLuo9CTRWd0pig=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek=
golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
golang.org/x/sync v0.25.0 h1:dJnifr0nMV8/SBnBvdo4eSGGnrc3O4FFx6IqvtLcmRs=
golang.org/x/sync v0.25.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -355,21 +357,21 @@ golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs=
golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/sys v0.50.0 h1:dkKZEFTEKaLr1sjhs0WiKqoi8Jj5nHbS3Njmx1UoMJs=
golang.org/x/sys v0.50.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.41.0 h1:vz/seA0lnX87Othu2f/0L24RcgrXD9/YFTSuGjj3rH8=
golang.org/x/text v0.41.0/go.mod h1:jvf1O8ajNzZqhSrQBPbutR/EB83Cc0CFrezNQIwbb5M=
golang.org/x/text v0.44.0 h1:YItdp/mQNGnsmrgpcdA5yQ3bnRxCfo/Tj/iByGW9GGo=
golang.org/x/text v0.44.0/go.mod h1:S4FR1waQ9LbjQTls97SyRjDaUUVkaM+cXwwuG/G+MwY=
golang.org/x/tools v0.0.0-20190424220101-1e8e1cfdf96b/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4=
gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E=
google.golang.org/genproto/googleapis/api v0.0.0-20260825221802-da73d73af1c5 h1:izFU9hz7aeLI/Mi1J0991ae+xcwRLr7hTqWnB/9aIIU=
google.golang.org/genproto/googleapis/api v0.0.0-20260825221802-da73d73af1c5/go.mod h1:3LhxRw4YYkf+ylAfgaY9JlVLFKhokkCV8duhLLe7+t0=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260825221802-da73d73af1c5 h1:1VUiZAXyC+zmiFYi+WLtBzr68Cj8wOofHjjrA/kkizc=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260825221802-da73d73af1c5/go.mod h1:DjtHYE8FKJLivXcBEjGwndXfIC23G0VpXiXKqG179uA=
google.golang.org/grpc v1.83.2 h1:EManeRomTObA0BU7I8vXgg/78uE5MJ9M8B39EX2WscU=
google.golang.org/grpc v1.83.2/go.mod h1:YPI1hK3kDked6iHvgX3tR0y+nX/qpMFKhPgFsokw1S8=
google.golang.org/genproto/googleapis/api v0.0.0-20261118221215-c8830f628b3f h1:7CbYDSDM5xqpq8v2tNm+Q057COf1lvA0gorVk+304tY=
google.golang.org/genproto/googleapis/api v0.0.0-20261118221215-c8830f628b3f/go.mod h1:CPxXEEQ1S9iJmInAF/8MNc8tKWnya8I8Kni9Zh2hV0M=
google.golang.org/genproto/googleapis/rpc v0.0.0-20261118221215-c8830f628b3f h1:aDW6Vb2T1K0xbAgW+ED8iz39WlgjjX/OKiNh6tXv/+g=
google.golang.org/genproto/googleapis/rpc v0.0.0-20261118221215-c8830f628b3f/go.mod h1:OaIUM3+LpYcK2GXM4FTmhWoIq371Owdr+Cc7/BsYHHc=
google.golang.org/grpc v1.85.0 h1:BPBCfuVRQ1qvBhKDOq9uvQllMvO59rKsYhXpp7Dd8vw=
google.golang.org/grpc v1.85.0/go.mod h1:0rQrOD58yjal/0EaVbGBANindixsCZNQPDV3VKtaKuQ=
google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc=
google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
@@ -386,11 +388,11 @@ gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
modernc.org/libc v1.74.3 h1:a4J+Z8aVaxPyjyxRAdJzw246PqpcFGvVPnfT/AuM5Ws=
modernc.org/libc v1.74.3/go.mod h1:4H7h/MJ8wnjL8RAbp9v3OXgnk22X7MouHIhDbvP3gj4=
modernc.org/libc v1.80.2 h1:3+a4fJZvvzg920ZC0mOepnKPGn7cqCaVeDxm/UnrM1A=
modernc.org/libc v1.80.2/go.mod h1:pvo25Rs3OJEbDqhUV9jdEGevxeLJrJeDmNid/AcQV1g=
modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU=
modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg=
modernc.org/memory v1.11.0 h1:o4QC8aMQzmcwCK3t3Ux/ZHmwFPzE6hf2Y5LbkRs+hbI=
modernc.org/memory v1.11.0/go.mod h1:/JP4VbVC+K5sU2wZi9bHoq2MAkCnrt2r98UGeSK7Mjw=
modernc.org/sqlite v1.54.0 h1:JCxR4qwkJvOaqAoYcgDoO25Nc+ROg6EJ2LfBVzdrgog=
modernc.org/sqlite v1.54.0/go.mod h1:4ntCLuNmnH8+GNqjka1wNg7KJd5/Hi5FYp8K+XQ7GZw=
modernc.org/memory v1.12.1 h1:nFMiWrpStgZczNl6XI9GnIk/rWhYIyHGUaR04pGbp9g=
modernc.org/memory v1.12.1/go.mod h1:/JP4VbVC+K5sU2wZi9bHoq2MAkCnrt2r98UGeSK7Mjw=
modernc.org/sqlite v1.62.0 h1:gMaCjSM1qpl+iOjiWhR1LYP3zqrYDI+5GYLGt6veP2g=
modernc.org/sqlite v1.62.0/go.mod h1:Jzjh1mt4s0HuQ0KvtB1LIuHiGRmU2D5pgj8dUhW7/SE=
+2 -1
View File
@@ -2,6 +2,7 @@ package middlewares
import (
"context"
"slices"
"github.com/txix-open/etp/v4"
@@ -27,7 +28,7 @@ func EtpLogger(logger log.Logger) EtpMiddleware {
//nolint:ireturn
func EtpChain(root etp.Handler, middlewares ...EtpMiddleware) etp.Handler {
for i := len(middlewares) - 1; i >= 0; i-- {
for i := range slices.Backward(middlewares) {
root = middlewares[i](root)
}
return root
@@ -0,0 +1,6 @@
-- +goose Up
-- +goose NO TRANSACTION
alter table isp_config_service__backend add column module_leader_mode text;
-- +goose Down
alter table isp_config_service__backend drop column module_leader_mode;
+28 -4
View File
@@ -28,17 +28,18 @@ func (r Backend) Upsert(ctx context.Context, backend entity.Backend) error {
query, args, err := squirrel.Insert(Table("backend")).
Columns("ws_connection_id", "module_id", "address",
"version", "lib_version", "module_name", "transport",
"config_service_node_id", "endpoints", "required_modules",
"metrics_autodiscovery").
"module_leader_mode", "config_service_node_id", "endpoints",
"required_modules", "metrics_autodiscovery").
Values(backend.WsConnectionId, backend.ModuleId, backend.Address,
backend.Version, backend.LibVersion, backend.ModuleName, backend.Transport,
backend.ConfigServiceNodeId, backend.Endpoints, backend.RequiredModules,
backend.MetricsAutodiscovery,
backend.ModuleLeaderMode, backend.ConfigServiceNodeId, backend.Endpoints,
backend.RequiredModules, backend.MetricsAutodiscovery,
).
Suffix(`on conflict (ws_connection_id) do update
set module_id = excluded.module_id, address = excluded.address,
version = excluded.version, lib_version = excluded.lib_version,
module_name = excluded.module_name, transport = excluded.transport,
module_leader_mode = excluded.module_leader_mode,
config_service_node_id = excluded.config_service_node_id,
endpoints = excluded.endpoints, required_modules = excluded.required_modules,
metrics_autodiscovery = excluded.metrics_autodiscovery`).
@@ -165,6 +166,29 @@ func (r Backend) GetByModuleId(ctx context.Context, moduleId string) ([]entity.B
return result, nil
}
func (r Backend) GetForLeaderElection(ctx context.Context, moduleId string) ([]entity.Backend, error) {
ctx = sql_metrics.OperationLabelToContext(ctx, "Backend.GetForLeaderElection")
// nolint:unqueryvet
query, args, err := squirrel.Select("*").
From(Table("backend")).
Where(squirrel.Eq{
"module_id": moduleId,
}).OrderBy("created_at asc", "ws_connection_id asc").
ToSql()
if err != nil {
return nil, errors.WithMessage(err, "build query")
}
result := make([]entity.Backend, 0)
err = r.db.Select(ctx, &result, query, args...)
if err != nil {
return nil, errors.WithMessagef(err, "select: %s", query)
}
return result, nil
}
func (r Backend) AllMetricsAutodiscovery(ctx context.Context) ([]entity.MetricsAdWrapper, error) {
ctx = sql_metrics.OperationLabelToContext(ctx, "Backend.AllMetricsAutodiscovery")
+4 -8
View File
@@ -157,14 +157,10 @@ func (r Variable) UpsertLinks(ctx context.Context, configId string, links []enti
}
for _, variable := range links {
query, args, err := squirrel.Insert(Table("config_has_variable")).
Columns("config_id", "variable_name").
Values(variable.ConfigId, variable.VariableName).
ToSql()
if err != nil {
return errors.WithMessage(err, "build query")
}
requests = append(requests, db.Request(query, args...))
requests = append(requests, db.Request(
`insert or ignore into `+Table("config_has_variable")+` (config_id, variable_name) values (?, ?)`,
variable.ConfigId, variable.VariableName,
))
}
_, err = r.db.ExecTransaction(ctx, requests)
+7 -7
View File
@@ -295,15 +295,15 @@ func (c Config) insertNewConfig(ctx context.Context, adminId int, req domain.Cre
Active: false,
AdminId: adminId,
}
err := c.configRepo.Insert(ctx, config)
if err != nil {
return domain.Config{}, errors.WithMessage(err, "insert new config")
}
// Check variables before insert so a config with missing variables is never persisted without links.
extractResult, err := c.extractAndCheckVariables(ctx, config.Id, config.Data)
if err != nil {
return domain.Config{}, err
}
err = c.configRepo.Insert(ctx, config)
if err != nil {
return domain.Config{}, errors.WithMessage(err, "insert new config")
}
err = c.variableService.SaveVariableLinks(ctx, config.Id, extractResult.VariableLinks)
if err != nil {
return domain.Config{}, errors.WithMessage(err, "save variable links")
@@ -323,7 +323,7 @@ func (c Config) extractAndCheckVariables(ctx context.Context, configId string, i
for _, variable := range variableExtractionResult.AbsentVariables {
details[variable] = "variable is not defined"
}
return nil, domain.NewConfigValidationError(details)
return nil, errors.WithMessage(domain.NewConfigValidationError(details), "config validation")
}
return variableExtractionResult, nil
}
@@ -345,7 +345,7 @@ func (c Config) validateConfigUpdate(ctx context.Context, moduleId string, confi
return nil
}
return domain.NewConfigValidationError(details)
return errors.WithMessage(domain.NewConfigValidationError(details), "config validation")
}
func (c Config) emitChangeActiveConfigEvent(ctx context.Context, moduleId string) error {
+17 -5
View File
@@ -12,6 +12,7 @@ import (
"isp-config-service/domain"
"isp-config-service/entity"
"isp-config-service/helpers"
"isp-config-service/service/module/leader"
)
type ModuleRepo interface {
@@ -84,9 +85,11 @@ func (s Module) Status(ctx context.Context) ([]domain.ModuleInfo, error) {
return nil, errors.WithMessage(err, "wait")
}
elections := leader.DeriveByModule(backends)
connections := make(map[string][]domain.Connection, len(modules))
for _, backend := range backends {
conn, err := s.backendToDto(backend)
conn, err := s.backendToDto(backend, isModuleLeader(elections, backend))
if err != nil {
return nil, errors.WithMessage(err, "backend to dto")
}
@@ -176,9 +179,11 @@ func (s Module) Connections(ctx context.Context) ([]domain.Connection, error) {
return nil, errors.WithMessage(err, "get all backends")
}
elections := leader.DeriveByModule(backends)
connections := make([]domain.Connection, 0, len(backends))
for _, backend := range backends {
conn, err := s.backendToDto(backend)
conn, err := s.backendToDto(backend, isModuleLeader(elections, backend))
if err != nil {
return nil, errors.WithMessage(err, "backend to dto")
}
@@ -188,7 +193,7 @@ func (s Module) Connections(ctx context.Context) ([]domain.Connection, error) {
return connections, nil
}
func (s Module) backendToDto(backend entity.Backend) (domain.Connection, error) {
func (s Module) backendToDto(backend entity.Backend, moduleLeader bool) (domain.Connection, error) {
addr, err := helpers.SplitAddress(backend)
if err != nil {
return domain.Connection{}, errors.WithMessage(err, "split address")
@@ -220,13 +225,20 @@ func (s Module) backendToDto(backend entity.Backend) (domain.Connection, error)
Ip: addr.IP,
Port: addr.Port,
},
Endpoints: endpointsDescriptors,
EstablishedAt: time.Time(backend.CreatedAt),
IsModuleLeader: moduleLeader,
Endpoints: endpointsDescriptors,
EstablishedAt: time.Time(backend.CreatedAt),
}
return conn, nil
}
func isModuleLeader(elections map[string]leader.Result, backend entity.Backend) bool {
election := elections[backend.ModuleId]
return election.Found && election.Leader.WsConnectionId == backend.WsConnectionId
}
func requiredModuleNamesByModuleId(backends []entity.Backend) map[string]map[string]struct{} {
result := make(map[string]map[string]struct{})
for _, backend := range backends {
+41
View File
@@ -0,0 +1,41 @@
package event_test
import (
"testing"
"isp-config-service/entity"
"isp-config-service/service/event"
"github.com/stretchr/testify/require"
)
const testModuleId = "test-module-id"
func TestCompactCollapsesModuleLifecycle(t *testing.T) {
t.Parallel()
require := require.New(t)
ready := entity.NewEvent(entity.EventPayload{
ModuleReady: &entity.PayloadModuleReady{ModuleId: testModuleId},
})
ready.Id = 1
disconnected := entity.NewEvent(entity.EventPayload{
ModuleDisconnected: &entity.PayloadModuleDisconnected{ModuleId: testModuleId},
})
disconnected.Id = 2
configUpdated := entity.NewEvent(entity.EventPayload{
ConfigUpdated: &entity.PayloadConfigUpdated{ModuleId: testModuleId},
})
configUpdated.Id = 3
require.Equal("module_lifecycle_"+testModuleId, ready.Key())
require.Equal("module_lifecycle_"+testModuleId, disconnected.Key())
require.Equal("config_updated_"+testModuleId, configUpdated.Key())
compacted := event.NewCompactor().Compact([]entity.Event{ready, disconnected, configUpdated})
require.Equal([]entity.Event{disconnected, configUpdated}, compacted,
"the newest lifecycle event wins, a config update is a key of its own")
}
+3 -1
View File
@@ -33,7 +33,9 @@ func (h Handler) Handle(ctx context.Context, events []entity.Event) {
routingChanged := false
for _, event := range events {
payload := event.Payload.Value
routingChanged = routingChanged || payload.ModuleReady != nil || payload.ModuleDisconnected != nil
routingChanged = routingChanged ||
payload.ModuleReady != nil ||
payload.ModuleDisconnected != nil
err := h.handleEvent(ctx, event)
if err != nil {
h.logger.Error(ctx, errors.WithMessagef(err, "handle event: %s", event.Key()))
+101
View File
@@ -0,0 +1,101 @@
package event_test
import (
"context"
"fmt"
"testing"
"isp-config-service/entity"
"isp-config-service/service/event"
"github.com/stretchr/testify/require"
"github.com/txix-open/isp-kit/log"
)
type subscriptionSpy struct {
backendsChanged []string
routingCalls int
}
func (s *subscriptionSpy) NotifyConfigChanged(ctx context.Context, moduleId string) error {
return nil
}
func (s *subscriptionSpy) NotifyBackendsChanged(ctx context.Context, moduleId string) error {
s.backendsChanged = append(s.backendsChanged, moduleId)
return nil
}
func (s *subscriptionSpy) NotifyRoutingChanged(ctx context.Context) error {
s.routingCalls++
return nil
}
type loggerSpy struct {
errors []string
}
func (l *loggerSpy) Error(ctx context.Context, message any, fields ...log.Field) {
l.errors = append(l.errors, fmt.Sprint(message))
}
func (l *loggerSpy) Warn(ctx context.Context, message any, fields ...log.Field) {}
func (l *loggerSpy) Info(ctx context.Context, message any, fields ...log.Field) {}
func (l *loggerSpy) Debug(ctx context.Context, message any, fields ...log.Field) {}
func moduleReadyEvent(id int) entity.Event {
event := entity.NewEvent(entity.EventPayload{
ModuleReady: &entity.PayloadModuleReady{ModuleId: testModuleId},
})
event.Id = id
return event
}
func moduleDisconnectedEvent(id int) entity.Event {
event := entity.NewEvent(entity.EventPayload{
ModuleDisconnected: &entity.PayloadModuleDisconnected{ModuleId: testModuleId},
})
event.Id = id
return event
}
func TestHandleLifecycleBatchFansRoutingOnce(t *testing.T) {
t.Parallel()
require := require.New(t)
subscription := &subscriptionSpy{}
logger := &loggerSpy{}
handler := event.NewHandler(subscription, logger)
batch := event.NewCompactor().Compact([]entity.Event{
moduleReadyEvent(1),
moduleDisconnectedEvent(2),
})
handler.Handle(t.Context(), batch)
require.Equal([]string{testModuleId}, subscription.backendsChanged,
"ready and disconnected collapse into the newest lifecycle event")
require.Equal(1, subscription.routingCalls, "the routing map is broadcast once per batch")
require.Empty(logger.errors)
}
func TestHandleUnknownEventDoesNotAbortBatch(t *testing.T) {
t.Parallel()
require := require.New(t)
subscription := &subscriptionSpy{}
logger := &loggerSpy{}
handler := event.NewHandler(subscription, logger)
unknown := entity.NewEvent(entity.EventPayload{})
handler.Handle(t.Context(), []entity.Event{unknown, moduleReadyEvent(1)})
require.Len(logger.errors, 1)
require.Contains(logger.errors[0], "unknown event")
require.Equal([]string{testModuleId}, subscription.backendsChanged,
"an unknown payload kind must not stop the batch")
require.Equal(1, subscription.routingCalls)
}
+29 -7
View File
@@ -79,6 +79,7 @@ func (s Backend) Connect(
LibVersion: declaration.LibVersion,
ModuleName: declaration.ModuleName,
Transport: declaration.Transport,
ModuleLeaderMode: s.normalizeModuleLeaderMode(ctx, declaration.ModuleName, declaration.ModuleLeaderMode),
ConfigServiceNodeId: s.nodeId,
Endpoints: xtypes.Json[[]cluster.EndpointDescriptor]{Value: declaration.Endpoints},
RequiredModules: xtypes.Json[[]cluster.ModuleDependency]{Value: declaration.RequiredModules},
@@ -110,7 +111,7 @@ func (s Backend) Disconnect(ctx context.Context, backend entity.Backend) error {
return errors.WithMessage(err, "delete backend in store")
}
err = s.insertDisconnectEvent(ctx, backend.ModuleId)
err = s.insertDisconnectEvent(ctx, backend)
if err != nil {
return errors.WithMessage(err, "insert disconnect event")
}
@@ -125,7 +126,7 @@ func (s Backend) ClearPhantomBackends(ctx context.Context) (int, error) {
}
toDelete := make([]string, 0)
modulesToDisconnect := make(map[string]bool)
phantoms := make(map[string]entity.Backend, len(backends))
for _, backend := range backends {
_, ok := s.rooms.Get(backend.WsConnectionId)
if ok {
@@ -133,7 +134,7 @@ func (s Backend) ClearPhantomBackends(ctx context.Context) (int, error) {
}
toDelete = append(toDelete, backend.WsConnectionId)
modulesToDisconnect[backend.ModuleId] = true
phantoms[backend.ModuleId] = backend
}
if len(toDelete) == 0 {
@@ -145,8 +146,8 @@ func (s Backend) ClearPhantomBackends(ctx context.Context) (int, error) {
return 0, errors.WithMessage(err, "delete backends by ws connection ids")
}
for moduleId := range modulesToDisconnect {
err := s.insertDisconnectEvent(ctx, moduleId)
for _, phantom := range phantoms {
err = s.insertDisconnectEvent(ctx, phantom)
if err != nil {
return 0, errors.WithMessage(err, "insert disconnect event")
}
@@ -164,15 +165,36 @@ func (s Backend) DeleteOwnBackends(ctx context.Context) {
s.logger.Info(ctx, fmt.Sprintf("delete %d own backends", deleted))
}
func (s Backend) insertDisconnectEvent(ctx context.Context, moduleId string) error {
func (s Backend) insertDisconnectEvent(ctx context.Context, backend entity.Backend) error {
event := entity.NewEvent(entity.EventPayload{
ModuleDisconnected: &entity.PayloadModuleDisconnected{
ModuleId: moduleId,
ModuleId: backend.ModuleId,
},
})
err := s.eventRepo.Insert(ctx, event)
if err != nil {
return errors.WithMessage(err, "insert event in store")
}
return nil
}
func (s Backend) normalizeModuleLeaderMode(
ctx context.Context,
moduleName string,
moduleLeaderMode string,
) string {
switch moduleLeaderMode {
case cluster.ModuleLeaderModeNone, cluster.ModuleLeaderModeRequestElection:
return moduleLeaderMode
}
s.logger.Warn(
ctx,
"unsupported module leader mode, stored as none",
log.String("moduleName", moduleName),
log.String("moduleLeaderMode", moduleLeaderMode),
)
return cluster.ModuleLeaderModeNone
}
+284
View File
@@ -0,0 +1,284 @@
package backend_test
import (
"context"
"testing"
"isp-config-service/entity"
"isp-config-service/service/module/backend"
"github.com/stretchr/testify/require"
"github.com/txix-open/etp/v4"
"github.com/txix-open/isp-kit/cluster"
"github.com/txix-open/isp-kit/log"
)
const (
testModuleName = "test-module"
testModuleId = "test-module-id"
testConnId = "test-conn-id"
testNodeId = "test-node-id"
leaderConnId = "conn-1"
followerConnId = "conn-2"
leaderAddress = "10.0.0.1:9000"
followerAddress = "10.0.0.2:9000"
)
type storedLog struct {
message any
fields map[string]string
}
type loggerSpy struct {
warns []storedLog
}
func (l *loggerSpy) Warn(ctx context.Context, message any, fields ...log.Field) {
entry := storedLog{
message: message,
fields: make(map[string]string, len(fields)),
}
for _, field := range fields {
entry.fields[field.Key] = field.String
}
l.warns = append(l.warns, entry)
}
func (l *loggerSpy) Error(ctx context.Context, message any, fields ...log.Field) {}
func (l *loggerSpy) Info(ctx context.Context, message any, fields ...log.Field) {}
func (l *loggerSpy) Debug(ctx context.Context, message any, fields ...log.Field) {}
type backendRepoSpy struct {
upserted []entity.Backend
deleted []string
calls []string
rows map[string]entity.Backend
}
func newBackendRepoSpy(backends ...entity.Backend) *backendRepoSpy {
rows := make(map[string]entity.Backend, len(backends))
for _, backend := range backends {
rows[backend.WsConnectionId] = backend
}
return &backendRepoSpy{rows: rows}
}
func (r *backendRepoSpy) Upsert(ctx context.Context, backend entity.Backend) error {
r.calls = append(r.calls, "upsert")
r.upserted = append(r.upserted, backend)
if r.rows == nil {
r.rows = make(map[string]entity.Backend, 1)
}
r.rows[backend.WsConnectionId] = backend
return nil
}
func (r *backendRepoSpy) DeleteByWsConnectionIds(ctx context.Context, wsConnIds []string) error {
r.calls = append(r.calls, "delete")
r.deleted = append(r.deleted, wsConnIds...)
for _, wsConnId := range wsConnIds {
delete(r.rows, wsConnId)
}
return nil
}
func (r *backendRepoSpy) GetByConfigServiceNodeId(ctx context.Context, configServiceNodeId string) ([]entity.Backend, error) {
r.calls = append(r.calls, "own_node")
ownNode := make([]entity.Backend, 0, len(r.rows))
for _, backend := range r.rows {
ownNode = append(ownNode, backend)
}
return ownNode, nil
}
func (r *backendRepoSpy) DeleteByConfigServiceNodeId(ctx context.Context, configServiceNodeId string) (int, error) {
return 0, nil
}
type eventRepoSpy struct {
inserted []entity.Event
}
func (r *eventRepoSpy) Insert(ctx context.Context, event entity.Event) error {
r.inserted = append(r.inserted, event)
return nil
}
func TestConnectNormalizesModuleLeaderMode(t *testing.T) {
t.Parallel()
tests := []struct {
expectedMode string
announcedMode string
name string
expectedWarn bool
}{
{
name: "request election is stored as is",
announcedMode: cluster.ModuleLeaderModeRequestElection,
expectedMode: cluster.ModuleLeaderModeRequestElection,
},
{
name: "empty mode is stored as empty",
announcedMode: cluster.ModuleLeaderModeNone,
expectedMode: cluster.ModuleLeaderModeNone,
},
{
name: "im leader is reserved",
announcedMode: cluster.ModuleLeaderModeImLeader,
expectedMode: cluster.ModuleLeaderModeNone,
expectedWarn: true,
},
{
name: "im follower is reserved",
announcedMode: cluster.ModuleLeaderModeImFollower,
expectedMode: cluster.ModuleLeaderModeNone,
expectedWarn: true,
},
{
name: "garbage is unknown",
announcedMode: "SOMETHING_ELSE",
expectedMode: cluster.ModuleLeaderModeNone,
expectedWarn: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
require := require.New(t)
logger := &loggerSpy{}
backendRepo := &backendRepoSpy{}
service := backend.NewBackend(backendRepo, &eventRepoSpy{}, testNodeId, nil, logger)
declaration := cluster.BackendDeclaration{
ModuleName: testModuleName,
Version: "1.0.0",
LibVersion: "1.0.0",
Address: cluster.AddressConfiguration{IP: "10.0.0.1", Port: "9000"},
ModuleLeaderMode: tt.announcedMode,
}
connected, err := service.Connect(t.Context(), testConnId, testModuleId, declaration)
require.NoError(err)
require.Len(backendRepo.upserted, 1)
require.Equal(tt.expectedMode, backendRepo.upserted[0].ModuleLeaderMode)
require.Equal(tt.expectedMode, connected.ModuleLeaderMode)
if !tt.expectedWarn {
require.Empty(logger.warns)
return
}
require.Len(logger.warns, 1)
require.Equal(testModuleName, logger.warns[0].fields["moduleName"])
require.Equal(tt.announcedMode, logger.warns[0].fields["moduleLeaderMode"])
})
}
}
func TestConnectInsertsOnlyLifecycleEvent(t *testing.T) {
t.Parallel()
require := require.New(t)
events := &eventRepoSpy{}
backendRepo := newBackendRepoSpy(electedInstance(leaderConnId, leaderAddress))
service := backend.NewBackend(backendRepo, events, testNodeId, nil, &loggerSpy{})
declaration := cluster.BackendDeclaration{
ModuleName: testModuleName,
Address: cluster.AddressConfiguration{IP: "10.0.0.2", Port: "9000"},
ModuleLeaderMode: cluster.ModuleLeaderModeRequestElection,
}
_, err := service.Connect(t.Context(), followerConnId, testModuleId, declaration)
require.NoError(err)
require.Equal([]string{"upsert"}, backendRepo.calls,
"the connect path elects nobody: the leader is derived where the address list is emitted")
require.Equal([]string{"module_lifecycle_" + testModuleId}, eventKeys(events),
"one lifecycle event per connect, no dedicated leader event")
}
func TestDisconnectInsertsOnlyLifecycleEvent(t *testing.T) {
t.Parallel()
require := require.New(t)
events := &eventRepoSpy{}
backendRepo := newBackendRepoSpy(
electedInstance(leaderConnId, leaderAddress),
electedInstance(followerConnId, followerAddress),
)
service := backend.NewBackend(backendRepo, events, testNodeId, nil, &loggerSpy{})
err := service.Disconnect(t.Context(), entity.Backend{
WsConnectionId: leaderConnId,
ModuleId: testModuleId,
ModuleName: testModuleName,
})
require.NoError(err)
require.Equal([]string{"delete"}, backendRepo.calls,
"the disconnect path elects nobody")
require.Equal([]string{"module_lifecycle_" + testModuleId}, eventKeys(events),
"one lifecycle event per disconnect, no dedicated leader event")
}
func TestClearPhantomBackendsInsertsOneLifecycleEventPerModule(t *testing.T) {
t.Parallel()
require := require.New(t)
events := &eventRepoSpy{}
backendRepo := newBackendRepoSpy(
electedInstance(leaderConnId, leaderAddress),
electedInstance(followerConnId, followerAddress),
)
service := backend.NewBackend(backendRepo, events, testNodeId, &etp.Rooms{}, &loggerSpy{})
deleted, err := service.ClearPhantomBackends(t.Context())
require.NoError(err)
require.Equal(2, deleted)
require.Equal([]string{"own_node", "delete"}, backendRepo.calls,
"the cleanup deletes and announces, it elects nobody")
require.Equal([]string{"module_lifecycle_" + testModuleId}, eventKeys(events),
"the instances of one module are announced once")
}
func TestDeleteOwnBackendsInsertsNoEvents(t *testing.T) {
t.Parallel()
require := require.New(t)
events := &eventRepoSpy{}
service := backend.NewBackend(newBackendRepoSpy(), events, testNodeId, nil, &loggerSpy{})
service.DeleteOwnBackends(t.Context())
require.Empty(events.inserted, "graceful shutdown inserts no events at all")
}
func electedInstance(connId string, address string) entity.Backend {
return entity.Backend{
WsConnectionId: connId,
ModuleId: testModuleId,
ModuleName: testModuleName,
Address: address,
ModuleLeaderMode: cluster.ModuleLeaderModeRequestElection,
}
}
func eventKeys(events *eventRepoSpy) []string {
keys := make([]string, 0, len(events.inserted))
for _, event := range events.inserted {
keys = append(keys, event.Key())
}
return keys
}
+66
View File
@@ -0,0 +1,66 @@
package leader
import (
"slices"
"strings"
"time"
"github.com/txix-open/isp-kit/cluster"
"isp-config-service/entity"
)
type Result struct {
HasElection bool
Found bool
Leader entity.Backend
}
func Derive(backends []entity.Backend) Result {
result := Result{
HasElection: hasElection(backends),
}
if !result.HasElection {
return result
}
candidates := slices.Clone(backends)
slices.SortFunc(candidates, compare)
result.Found = true
result.Leader = candidates[0]
return result
}
func DeriveByModule(backends []entity.Backend) map[string]Result {
byModule := make(map[string][]entity.Backend, len(backends))
for _, backend := range backends {
byModule[backend.ModuleId] = append(byModule[backend.ModuleId], backend)
}
elections := make(map[string]Result, len(byModule))
for moduleId, moduleBackends := range byModule {
elections[moduleId] = Derive(moduleBackends)
}
return elections
}
func hasElection(backends []entity.Backend) bool {
for _, backend := range backends {
if backend.ModuleLeaderMode == cluster.ModuleLeaderModeRequestElection {
return true
}
}
return false
}
func compare(a, b entity.Backend) int {
byCreatedAt := time.Time(a.CreatedAt).Compare(time.Time(b.CreatedAt))
if byCreatedAt != 0 {
return byCreatedAt
}
return strings.Compare(a.WsConnectionId, b.WsConnectionId)
}
+154
View File
@@ -0,0 +1,154 @@
package leader_test
import (
"slices"
"testing"
"time"
"isp-config-service/entity"
"isp-config-service/entity/xtypes"
"isp-config-service/service/module/leader"
"github.com/stretchr/testify/require"
"github.com/txix-open/isp-kit/cluster"
)
const (
electionMode = cluster.ModuleLeaderModeRequestElection
noElectionMode = cluster.ModuleLeaderModeNone
garbageMode = "SOMETHING_ELSE"
)
func TestDerive(t *testing.T) {
t.Parallel()
require := require.New(t)
elected := leader.Derive(instances(
instance("conn-c", 100, noElectionMode),
instance("conn-a", 200, electionMode),
instance("conn-b", 100, noElectionMode),
))
require.True(elected.HasElection)
require.True(elected.Found)
require.Equal("conn-b", elected.Leader.WsConnectionId, "leader is the earliest instance, tie broken by ws_connection_id")
first := leader.Derive(instances(
instance("conn-c", 100, noElectionMode),
instance("conn-a", 200, electionMode),
instance("conn-b", 100, noElectionMode),
))
second := leader.Derive(instances(
instance("conn-a", 200, electionMode),
instance("conn-b", 100, noElectionMode),
instance("conn-c", 100, noElectionMode),
))
require.Equal(first, second, "the same set of instances must yield the same leader")
require.Equal(elected.Leader.WsConnectionId, first.Leader.WsConnectionId)
require.Equal(elected.Leader.WsConnectionId, second.Leader.WsConnectionId)
}
func TestDerive_InputOrder(t *testing.T) {
t.Parallel()
require := require.New(t)
base := instances(
instance("conn-d", 100, electionMode),
instance("conn-a", 300, electionMode),
instance("conn-c", 100, noElectionMode),
instance("conn-b", 200, noElectionMode),
)
expected := leader.Derive(base)
require.Equal("conn-c", expected.Leader.WsConnectionId)
for _, input := range permutations(base) {
original := slices.Clone(base)
got := leader.Derive(input)
require.Equal(expected, got, "input order must not change the result")
require.Equal(original, base, "Derive must not mutate the caller slice")
}
}
func TestDerive_NoElection(t *testing.T) {
t.Parallel()
require := require.New(t)
got := leader.Derive(instances(
instance("conn-a", 100, noElectionMode),
instance("conn-b", 200, cluster.ModuleLeaderModeImLeader),
instance("conn-c", 50, garbageMode),
))
require.False(got.HasElection)
require.False(got.Found)
require.Equal(entity.Backend{}, got.Leader)
}
func TestDerive_SingleInstance(t *testing.T) {
t.Parallel()
require := require.New(t)
got := leader.Derive(instances(instance("conn-a", 100, electionMode)))
require.True(got.HasElection)
require.True(got.Found)
require.Equal("conn-a", got.Leader.WsConnectionId)
}
func TestDerive_NoInstances(t *testing.T) {
t.Parallel()
require := require.New(t)
got := leader.Derive(nil)
require.False(got.HasElection)
require.False(got.Found)
require.Equal(entity.Backend{}, got.Leader)
}
func TestDeriveByModule(t *testing.T) {
t.Parallel()
require := require.New(t)
first := instance("conn-a", 100, electionMode)
first.ModuleId = "module-1"
first.ModuleName = "module-one"
second := instance("conn-b", 200, noElectionMode)
second.ModuleId = "module-2"
second.ModuleName = "module-two"
elections := leader.DeriveByModule(instances(second, first))
require.Len(elections, 2, "every module gets its own election")
require.Equal("conn-a", elections["module-1"].Leader.WsConnectionId)
require.False(elections["module-2"].HasElection, "an instance of another module must not start an election")
}
func instance(wsConnectionId string, createdAt int64, mode string) entity.Backend {
return entity.Backend{
WsConnectionId: wsConnectionId,
ModuleId: "module-id",
ModuleName: "module",
Address: "10.2.9.1:9999",
ModuleLeaderMode: mode,
CreatedAt: xtypes.Time(time.Unix(createdAt, 0)),
}
}
func instances(backends ...entity.Backend) []entity.Backend {
return backends
}
func permutations(backends []entity.Backend) [][]entity.Backend {
reversed := slices.Clone(backends)
slices.Reverse(reversed)
rotated := append(slices.Clone(backends[1:]), backends[0])
return [][]entity.Backend{backends, reversed, rotated}
}
+6 -5
View File
@@ -221,18 +221,19 @@ func (s Service) OnModuleConfigSchema(
Version: 1,
Active: xtypes.Bool(true),
}
err := s.configRepo.Insert(ctx, initialConfig)
if err != nil {
return errors.WithMessage(err, "insert config in store")
}
result, err := s.variableService.ExtractVariables(ctx, initialConfig.Id, initialConfig.Data)
if err != nil {
return errors.WithMessage(err, "extract and save variable links in store")
return errors.WithMessage(err, "extract variables from initial config")
}
if len(result.AbsentVariables) > 0 {
return errors.Errorf("missing variables in initial config: [%s]", strings.Join(result.AbsentVariables, ","))
}
err = s.configRepo.Insert(ctx, initialConfig)
if err != nil {
return errors.WithMessage(err, "insert config in store")
}
err = s.variableService.SaveVariableLinks(ctx, initialConfig.Id, result.VariableLinks)
if err != nil {
return errors.WithMessage(err, "save variable links in store")
+6
View File
@@ -148,6 +148,12 @@ func (d Adapter) exec(ctx context.Context, inTx bool, requests [][]any) ([]sql.R
results := make([]sql.Result, 0, len(requests))
for _, result := range resp.Results {
// rqlite reports per-statement failures in individual results with HTTP 200,
// and aborts the whole transaction on the first failed statement.
err := catchError(nil, result)
if err != nil {
return nil, errors.WithMessagef(err, "exec transaction on statement: %v", requests[min(len(results), len(requests)-1)])
}
results = append(results, result)
}
+7
View File
@@ -42,6 +42,7 @@ type Service struct {
// initialized in Run
locatorConfig *assembly.Config
db db.DB
}
func New(boot *bootstrap.Bootstrap) (*Service, error) {
@@ -129,6 +130,7 @@ func (s *Service) Run(ctx context.Context) error {
if err != nil {
return errors.WithMessage(err, "dial to embedded rqlite")
}
s.db = db
cfg := assembly.LocalConfig{
Local: s.cfg,
@@ -209,6 +211,11 @@ func (s *Service) Closers() []app.Closer {
}
}
// nolint:ireturn
func (s *Service) Db() db.DB {
return s.db
}
func (s *Service) leaderStartup(ctx context.Context) error {
db, err := s.rqlite.SqlDB()
if err != nil {
+75 -8
View File
@@ -2,6 +2,8 @@ package subscription
import (
"context"
"slices"
"strings"
"github.com/txix-open/etp/v4"
@@ -11,6 +13,7 @@ import (
"github.com/txix-open/isp-kit/log"
"isp-config-service/entity"
"isp-config-service/helpers"
"isp-config-service/service/module/leader"
"isp-config-service/service/rqlite/db"
)
@@ -20,7 +23,7 @@ type ModuleRepo interface {
}
type BackendRepo interface {
GetByModuleId(ctx context.Context, moduleId string) ([]entity.Backend, error)
GetForLeaderElection(ctx context.Context, moduleId string) ([]entity.Backend, error)
All(ctx context.Context) ([]entity.Backend, error)
}
@@ -173,20 +176,48 @@ func (s Service) notifyBackendsChanged(
conns []*etp.Conn,
) error {
ctx = db.NoneConsistency().ToContext(ctx)
backends, err := s.backendRepo.GetByModuleId(ctx, moduleId)
backends, err := s.backendRepo.GetForLeaderElection(ctx, moduleId)
if err != nil {
return errors.WithMessage(err, "get backends by module id")
}
addresses := make([]cluster.AddressConfiguration, 0)
for _, backend := range backends {
addr, err := helpers.SplitAddress(backend)
election := leader.Derive(backends)
if election.HasElection {
return s.emitLeaderAddress(ctx, moduleName, election, conns)
}
addresses, err := moduleAddresses(backends)
if err != nil {
return errors.WithMessage(err, "split address")
}
s.emitModuleConnectedEvent(ctx, conns, moduleName, addresses)
return nil
}
func (s Service) emitLeaderAddress(
ctx context.Context,
moduleName string,
election leader.Result,
conns []*etp.Conn,
) error {
addresses := make([]cluster.AddressConfiguration, 0, 1)
leaderAddress := ""
if election.Found {
address, err := helpers.SplitAddress(election.Leader)
if err != nil {
return errors.WithMessage(err, "split address")
}
addresses = append(addresses, addr)
address.IsModuleLeader = true
addresses = append(addresses, address)
leaderAddress = election.Leader.Address
}
s.logger.Info(ctx, "module address list narrowed to the leader",
log.String("moduleName", moduleName),
log.String("leaderAddress", leaderAddress))
s.emitModuleConnectedEvent(ctx, conns, moduleName, addresses)
return nil
@@ -199,12 +230,25 @@ func (s Service) notifyRoutingChanged(ctx context.Context, event string, conns [
return errors.WithMessage(err, "get all backends")
}
elections := leader.DeriveByModule(backends)
moduleLeaders := make([]string, 0, len(elections))
routingConfig := cluster.RoutingConfig{}
for _, backend := range backends {
addr, err := helpers.SplitAddress(backend)
election := elections[backend.ModuleId]
if election.HasElection && election.Leader.WsConnectionId != backend.WsConnectionId {
continue
}
address, err := helpers.SplitAddress(backend)
if err != nil {
return errors.WithMessage(err, "split address")
}
if election.HasElection {
moduleLeaders = append(moduleLeaders, backend.ModuleName+"="+backend.Address)
}
declaration := cluster.BackendDeclaration{
ModuleName: backend.ModuleName,
Version: backend.Version,
@@ -212,10 +256,20 @@ func (s Service) notifyRoutingChanged(ctx context.Context, event string, conns [
Transport: backend.Transport,
Endpoints: backend.Endpoints.Value,
RequiredModules: backend.RequiredModules.Value,
Address: addr,
Address: cluster.AddressConfiguration{
IP: address.IP,
Port: address.Port,
IsModuleLeader: election.HasElection,
},
}
routingConfig = append(routingConfig, declaration)
}
if len(moduleLeaders) > 0 {
s.logger.Info(ctx, "routing map publishes module leaders",
log.String("moduleLeaders", strings.Join(moduleLeaders, ",")))
}
data, err := json.Marshal(routingConfig)
if err != nil {
return errors.WithMessage(err, "marshal routing config")
@@ -244,3 +298,16 @@ func (s Service) emitModuleConnectedEvent(
}()
}
}
func moduleAddresses(backends []entity.Backend) ([]cluster.AddressConfiguration, error) {
addresses := make([]cluster.AddressConfiguration, 0, len(backends))
for i := range slices.Backward(backends) {
address, err := helpers.SplitAddress(backends[i])
if err != nil {
return nil, errors.WithMessage(err, "split address")
}
addresses = append(addresses, address)
}
return addresses, nil
}
+189
View File
@@ -0,0 +1,189 @@
package subscription_test
import (
"context"
"testing"
"isp-config-service/entity"
"isp-config-service/service/subscription"
"github.com/stretchr/testify/require"
"github.com/txix-open/etp/v4"
"github.com/txix-open/isp-kit/cluster"
"github.com/txix-open/isp-kit/log"
)
const (
testModuleId = "test-module-id"
testModuleName = "test-module"
leaderConnId = "conn-1"
followerConnId = "conn-2"
leaderAddress = "10.0.0.1:9000"
successorAddress = "10.0.0.2:9000"
plainAddress = "10.0.0.3:9000"
)
type storedLog struct {
message any
fields map[string]string
}
type loggerSpy struct {
infos []storedLog
}
func (l *loggerSpy) Info(ctx context.Context, message any, fields ...log.Field) {
entry := storedLog{
message: message,
fields: make(map[string]string, len(fields)),
}
for _, field := range fields {
entry.fields[field.Key] = field.String
}
l.infos = append(l.infos, entry)
}
func (l *loggerSpy) Error(ctx context.Context, message any, fields ...log.Field) {}
func (l *loggerSpy) Warn(ctx context.Context, message any, fields ...log.Field) {}
func (l *loggerSpy) Debug(ctx context.Context, message any, fields ...log.Field) {}
type moduleRepoSpy struct{}
func (r *moduleRepoSpy) GetByNames(ctx context.Context, names []string) ([]entity.Module, error) {
return []entity.Module{{Id: testModuleId, Name: testModuleName}}, nil
}
func (r *moduleRepoSpy) GetById(ctx context.Context, id string) (*entity.Module, error) {
return &entity.Module{Id: testModuleId, Name: testModuleName}, nil
}
type backendRepoSpy struct {
forLeaderElection []entity.Backend
all []entity.Backend
}
func (r *backendRepoSpy) GetForLeaderElection(ctx context.Context, moduleId string) ([]entity.Backend, error) {
return r.forLeaderElection, nil
}
func (r *backendRepoSpy) All(ctx context.Context) ([]entity.Backend, error) {
return r.all, nil
}
type configRepoSpy struct{}
func (r *configRepoSpy) GetActive(ctx context.Context, moduleId string) (*entity.Config, error) {
return &entity.Config{ModuleId: moduleId}, nil
}
type variableServiceSpy struct{}
func (s *variableServiceSpy) RenderConfig(ctx context.Context, input []byte) ([]byte, error) {
return input, nil
}
type emitterSpy struct{}
func (e *emitterSpy) Emit(ctx context.Context, conn *etp.Conn, event string, data []byte) {}
// The on-call engineer answers "who is accepting sessions of this module" from the log of the node that
// emitted the address list: the same derivation the subscriber received, logged where it is published.
func TestNotifyBackendsChangedLogsTheLeaderItPublishes(t *testing.T) {
t.Parallel()
require := require.New(t)
logger := &loggerSpy{}
rooms := etp.NewServer().Rooms()
rooms.Join(&etp.Conn{}, subscription.BackendsChangingRoom(testModuleName))
service := newService(logger, rooms, &backendRepoSpy{
forLeaderElection: []entity.Backend{
electedInstance(leaderConnId, leaderAddress),
electedInstance(followerConnId, successorAddress),
},
})
err := service.NotifyBackendsChanged(t.Context(), testModuleId)
require.NoError(err)
require.Len(logger.infos, 1)
require.Equal("module address list narrowed to the leader", logger.infos[0].message)
require.Equal(testModuleName, logger.infos[0].fields["moduleName"])
require.Equal(leaderAddress, logger.infos[0].fields["leaderAddress"],
"the logged leader is the oldest elected instance, the one the subscriber received")
}
func TestNotifyRoutingChangedLogsPublishedLeaders(t *testing.T) {
t.Parallel()
require := require.New(t)
logger := &loggerSpy{}
rooms := etp.NewServer().Rooms()
rooms.Join(&etp.Conn{}, subscription.RoutingChangingRoom())
service := newService(logger, rooms, &backendRepoSpy{
all: []entity.Backend{
electedInstance(leaderConnId, leaderAddress),
electedInstance(followerConnId, successorAddress),
plainInstance("conn-3", plainAddress),
},
})
err := service.NotifyRoutingChanged(t.Context())
require.NoError(err)
require.Len(logger.infos, 1, "one summary line per routing rebuild")
require.Equal("routing map publishes module leaders", logger.infos[0].message)
require.Equal(testModuleName+"="+leaderAddress, logger.infos[0].fields["moduleLeaders"],
"only the elected module and only its leader are published, the plain module is not listed")
}
func TestNotifyRoutingChangedWithoutElectionLogsNothing(t *testing.T) {
t.Parallel()
require := require.New(t)
logger := &loggerSpy{}
rooms := etp.NewServer().Rooms()
rooms.Join(&etp.Conn{}, subscription.RoutingChangingRoom())
service := newService(logger, rooms, &backendRepoSpy{
all: []entity.Backend{plainInstance("conn-3", plainAddress)},
})
err := service.NotifyRoutingChanged(t.Context())
require.NoError(err)
require.Empty(logger.infos, "modules without election keep the previous behaviour, including the log")
}
func electedInstance(connId string, address string) entity.Backend {
return entity.Backend{
WsConnectionId: connId,
ModuleId: testModuleId,
ModuleName: testModuleName,
Address: address,
ModuleLeaderMode: cluster.ModuleLeaderModeRequestElection,
}
}
func plainInstance(connId string, address string) entity.Backend {
return entity.Backend{
WsConnectionId: connId,
ModuleId: "plain-module-id",
ModuleName: "plain-module",
Address: address,
}
}
func newService(logger log.Logger, rooms *etp.Rooms, backendRepo subscription.BackendRepo) subscription.Service {
return subscription.NewService(
&moduleRepoSpy{},
backendRepo,
&configRepoSpy{},
rooms,
&emitterSpy{},
&variableServiceSpy{},
logger,
)
}
+9 -3
View File
@@ -215,9 +215,15 @@ func (s Service) RenderConfig(ctx context.Context, input []byte) ([]byte, error)
func (s Service) ExtractVariables(ctx context.Context, configId string, input []byte) (*domain.VariableExtractionResult, error) {
matches := s.variableRegexp.FindAllStringSubmatch(string(input), -1)
varNames := make([]string, len(matches))
for i, match := range matches {
varNames[i] = match[1]
seen := make(map[string]bool, len(matches))
varNames := make([]string, 0, len(matches))
for _, match := range matches {
name := match[1]
if seen[name] {
continue
}
seen[name] = true
varNames = append(varNames, name)
}
if len(varNames) == 0 {
return &domain.VariableExtractionResult{
+40 -1
View File
@@ -11,6 +11,7 @@ import (
"isp-config-service/conf"
"isp-config-service/domain"
"isp-config-service/service/rqlite/db"
"isp-config-service/service/startup"
"github.com/stretchr/testify/require"
@@ -90,6 +91,12 @@ func TestAcceptance(t *testing.T) {
require.EqualValues([]string{"10.2.9.1:9999"}, eventHandler.ReceivedHosts()[1])
require.Len(eventHandler.ReceivedRoutes(), 3)
for _, routes := range eventHandler.ReceivedRoutes() {
for _, declaration := range routes {
require.EqualValues(cluster.ModuleLeaderModeNone, declaration.ModuleLeaderMode)
require.False(declaration.Address.IsModuleLeader)
}
}
statusResponse := make([]domain.ModuleInfo, 0)
err = apiCli.Invoke("config/module/get_modules_info").
@@ -138,6 +145,29 @@ func newClusterClientWith(
defaultRemoteConfig []byte,
metricsAd *cluster.MetricsAutodiscovery,
logger log.Logger,
) *cluster.Client {
t.Helper()
return newClusterClientFull(
t,
moduleName,
host,
config,
defaultRemoteConfig,
metricsAd,
cluster.ModuleLeaderModeNone,
logger,
)
}
func newClusterClientFull(
t *testing.T,
moduleName string,
host string,
config any,
defaultRemoteConfig []byte,
metricsAd *cluster.MetricsAutodiscovery,
moduleLeaderMode string,
logger log.Logger,
) *cluster.Client {
t.Helper()
schema := schema.NewGenerator().Generate(config)
@@ -155,6 +185,7 @@ func newClusterClientWith(
},
EndpointsResolver: cluster.StaticEndpointResolver{},
MetricsAutodiscovery: metricsAd,
ModuleLeaderMode: moduleLeaderMode,
}, cluster.ConfigData{
Version: "1.0.0",
Schema: schemaData,
@@ -168,6 +199,14 @@ func newClusterClientWith(
func setupTest(t *testing.T) log.Logger {
t.Helper()
_, logger, _ := setupTestApp(t)
return logger
}
// nolint:ireturn
func setupTestApp(t *testing.T) (*require.Assertions, log.Logger, db.DB) {
t.Helper()
require := require.New(t)
t.Setenv("APP_CONFIG_PATH", "../conf/config.yml")
@@ -191,5 +230,5 @@ func setupTest(t *testing.T) log.Logger {
require.NoError(err)
time.Sleep(1 * time.Second)
return logger
return require, logger, startup.Db()
}
+213
View File
@@ -0,0 +1,213 @@
package tests_test
import (
"context"
"net"
"slices"
"testing"
"isp-config-service/domain"
"github.com/stretchr/testify/require"
"github.com/txix-open/isp-kit/cluster"
"github.com/txix-open/isp-kit/grpc/client"
)
const (
apiObserverModule = "apiobserver"
apiObserverIP = "10.2.9.20"
apiSilentModule = "apisilent"
apiSilentHost = "10.2.9.21"
modulesInfoEndpoint = "config/module/get_modules_info"
routesEndpoint = "config/routing/get_routes"
)
//nolint:funlen,paralleltest
func TestModuleLeaderApiFlag(t *testing.T) {
require, logger, testDb := setupTestApp(t)
ctx := t.Context()
apiCli, err := client.Default()
require.NoError(err)
apiCli.Upgrade([]string{"127.0.0.1:9002"})
observer := newClusterEventHandler()
runClusterClient(ctx, require,
newClusterClient(t, apiObserverModule, apiObserverIP, logger),
cluster.NewEventHandler().RequireModule(electionModule, observer).RoutesReceiver(observer),
)
instances := []moduleInstance{
startModuleInstance(t, electionModule, electionHostOne, cluster.ModuleLeaderModeRequestElection, logger),
startModuleInstance(t, electionModule, electionHostTwo, cluster.ModuleLeaderModeRequestElection, logger),
startModuleInstance(t, electionModule, electionHostThree, cluster.ModuleLeaderModeRequestElection, logger),
startModuleInstance(t, plainModule, plainHostOne, cluster.ModuleLeaderModeNone, logger),
startModuleInstance(t, plainModule, plainHostTwo, cluster.ModuleLeaderModeNone, logger),
startModuleInstance(t, apiSilentModule, apiSilentHost, cluster.ModuleLeaderModeNone, logger),
}
byHost := make(map[string]moduleInstance, len(instances))
for _, instance := range instances {
byHost[instance.host] = instance
}
connected := map[string]int{electionModule: 3, plainModule: 2, apiSilentModule: 1}
require.Eventually(func() bool {
return len(selectLeaderOrder(ctx, testDb, electionModule)) == 3 &&
len(selectLeaderOrder(ctx, testDb, plainModule)) == 2 &&
len(selectLeaderOrder(ctx, testDb, apiSilentModule)) == 1
}, announceTimeout, announceTick, "every instance must be connected")
elected := selectLeaderOrder(ctx, testDb, electionModule)
derivedLeader := elected[0].Address
require.Eventually(func() bool {
return slices.Equal(lastHosts(observer), []string{derivedLeader})
}, announceTimeout, announceTick, "the subscriber must be balanced to the derived leader")
observedLeader := lastHosts(observer)[0]
status := requireApiCounts(t, ctx, apiCli, modulesInfoEndpoint, instanceCount, connected)
electionInfo := findModule(status, electionModule)
require.NotNil(electionInfo, electionModule)
require.True(electionInfo.Active)
require.Len(electionInfo.Status, 3, "modules info must keep every instance of the elected module")
apiLeader := requireSingleLeader(require, electionInfo.Status)
require.Equal(derivedLeader, apiLeader, "the leader of the API must be the leader derived from the DB")
require.Equal(observedLeader, apiLeader, "the leader of the API must be the address the subscriber receives")
requireNoLeaders(require, connectionsOf(status, plainModule), plainModule)
requireNoLeaders(require, connectionsOf(status, apiSilentModule), apiSilentModule)
routes := requireApiCounts(t, ctx, apiCli, routesEndpoint, connectionCount, connected)
require.Len(connectionsOfModule(routes, electionModule), 3, "routes must not narrow the elected module")
require.Equal(apiLeader, requireSingleLeader(require, connectionsOfModule(routes, electionModule)),
"routes must mark the same leader as modules info")
requireNoLeaders(require, connectionsOfModule(routes, plainModule), plainModule)
byHost[apiSilentHost].disconnect(t)
byHost[hostOf(t, elected[1].Address)].disconnect(t)
byHost[hostOf(t, elected[2].Address)].disconnect(t)
status = requireApiCounts(t, ctx, apiCli, modulesInfoEndpoint, instanceCount, map[string]int{
electionModule: 1,
plainModule: 2,
apiSilentModule: 0,
})
silentInfo := findModule(status, apiSilentModule)
require.NotNil(silentInfo, apiSilentModule)
require.False(silentInfo.Active)
require.Empty(silentInfo.Status, "a module without instances has no connection to mark")
electionInfo = findModule(status, electionModule)
require.NotNil(electionInfo, electionModule)
require.True(electionInfo.Active)
require.Len(electionInfo.Status, 1)
require.True(electionInfo.Status[0].IsModuleLeader, "the only instance of an elected module is its leader")
require.Equal(derivedLeader, connectionAddress(electionInfo.Status[0]),
"dropping standbys must not move leadership")
}
func connectionsOf(modules []domain.ModuleInfo, moduleName string) []domain.Connection {
for _, module := range modules {
if module.Name == moduleName {
return module.Status
}
}
return nil
}
func connectionsOfModule(connections []domain.Connection, moduleName string) []domain.Connection {
ofModule := make([]domain.Connection, 0, len(connections))
for _, connection := range connections {
if connection.ModuleName == moduleName {
ofModule = append(ofModule, connection)
}
}
return ofModule
}
func connectionAddress(connection domain.Connection) string {
return net.JoinHostPort(connection.Address.Ip, connection.Address.Port)
}
func requireSingleLeader(require *require.Assertions, connections []domain.Connection) string {
leaders := make([]string, 0, 1)
for _, connection := range connections {
if connection.IsModuleLeader {
leaders = append(leaders, connectionAddress(connection))
}
}
require.Len(leaders, 1, "an elected module must expose exactly one leader")
return leaders[0]
}
func requireNoLeaders(require *require.Assertions, connections []domain.Connection, moduleName string) {
require.NotEmpty(connections, moduleName)
for _, connection := range connections {
require.False(connection.IsModuleLeader, "a module without election must not expose a leader: "+moduleName)
}
}
func instanceCount(module domain.ModuleInfo) map[string]int {
return map[string]int{module.Name: len(module.Status)}
}
func connectionCount(connection domain.Connection) map[string]int {
return map[string]int{connection.ModuleName: 1}
}
func requireApiCounts[T any](
t *testing.T,
ctx context.Context,
apiCli *client.Client,
endpoint string,
countsOf func(row T) map[string]int,
expected map[string]int,
) []T {
t.Helper()
require := require.New(t)
rows := make([]T, 0)
require.Eventually(func() bool {
latest := make([]T, 0)
err := apiCli.Invoke(endpoint).JsonResponseBody(&latest).Do(ctx)
if err != nil {
return false
}
rows = latest
return countsMatch(countsByModule(rows, countsOf), expected)
}, announceTimeout, announceTick, endpoint+" must report every instance")
return rows
}
func countsByModule[T any](rows []T, countsOf func(row T) map[string]int) map[string]int {
counts := make(map[string]int, len(rows))
for _, row := range rows {
for moduleName, total := range countsOf(row) {
counts[moduleName] += total
}
}
return counts
}
func countsMatch(counts, expected map[string]int) bool {
for moduleName, total := range expected {
if counts[moduleName] != total {
return false
}
}
return true
}
+349
View File
@@ -0,0 +1,349 @@
package tests_test
import (
"context"
"net"
"slices"
"strings"
"testing"
"isp-config-service/service/rqlite/db"
"github.com/stretchr/testify/require"
"github.com/txix-open/isp-kit/cluster"
"github.com/txix-open/isp-kit/log"
)
const (
electionHostOne = "10.2.9.1"
electionHostTwo = "10.2.9.2"
electionHostThree = "10.2.9.3"
plainModule = "plain"
plainHostOne = "10.2.9.7"
plainHostTwo = "10.2.9.8"
plainObserverModule = "plainobserver"
plainObserverIP = "10.2.9.10"
electionObserverModule = "electionobserver"
electionObserverIP = "10.2.9.9"
lateObserverModule = "lateobserver"
lateObserverIP = "10.2.9.11"
noLeaderModule = "noleader"
noLeaderHostOne = "10.2.9.12"
noLeaderHostTwo = "10.2.9.13"
noLeaderObserverIP = "10.2.9.14"
noLeaderObserverName = "noleaderobserver"
instancePort = "9999"
)
// nolint:tagliatelle
type leaderOrderRow struct {
WsConnectionId string `json:"ws_connection_id"`
Address string `json:"address"`
}
// nolint:tagliatelle
type schemaNameRow struct {
Name string `json:"name"`
}
type moduleInstance struct {
host string
cli *cluster.Client
cancel context.CancelFunc
}
//nolint:funlen,paralleltest
func TestModuleLeaderElection(t *testing.T) {
require, logger, testDb := setupTestApp(t)
ctx := t.Context()
electionObserver := newClusterEventHandler()
runClusterClient(ctx, require,
newClusterClient(t, electionObserverModule, electionObserverIP, logger),
cluster.NewEventHandler().RequireModule(electionModule, electionObserver).RoutesReceiver(electionObserver),
)
plainObserver := newClusterEventHandler()
runClusterClient(ctx, require,
newClusterClient(t, plainObserverModule, plainObserverIP, logger),
cluster.NewEventHandler().RequireModule(plainModule, plainObserver).RoutesReceiver(plainObserver),
)
electedInstances := []moduleInstance{
startModuleInstance(t, electionModule, electionHostOne, cluster.ModuleLeaderModeRequestElection, logger),
startModuleInstance(t, electionModule, electionHostTwo, cluster.ModuleLeaderModeRequestElection, logger),
startModuleInstance(t, electionModule, electionHostThree, cluster.ModuleLeaderModeRequestElection, logger),
}
byHost := make(map[string]moduleInstance, len(electedInstances))
for _, instance := range electedInstances {
byHost[instance.host] = instance
}
startModuleInstance(t, plainModule, plainHostOne, cluster.ModuleLeaderModeNone, logger)
startModuleInstance(t, plainModule, plainHostTwo, cluster.ModuleLeaderModeNone, logger)
announced := []string{addressOf(electionHostOne), addressOf(electionHostTwo), addressOf(electionHostThree)}
require.Eventually(func() bool {
return len(selectLeaderOrder(ctx, testDb, electionModule)) == 3
}, announceTimeout, announceTick, "all three instances of %s must be connected", electionModule)
elected := selectLeaderOrder(ctx, testDb, electionModule)
expectedLeader := elected[0].Address
expectedSuccessor := elected[1].Address
require.Eventually(func() bool {
return slices.Equal(lastHosts(electionObserver), []string{expectedLeader})
}, announceTimeout, announceTick, "the address list of an elected module must keep exactly the derived leader")
received := lastHosts(electionObserver)
require.Len(received, 1, "an elected module must be balanced to a single address")
require.Contains(announced, received[0], "the leader must be one of the announced instances")
require.Eventually(func() bool {
return routingLeaderOf(electionObserver, electionModule) == expectedLeader
}, announceTimeout, announceTick, "the routing map of an elected module must publish only the leader")
requireRoutingLeader(require, lastRoutesOf(electionObserver, electionModule), expectedLeader)
require.Eventually(func() bool {
return len(lastRoutesOf(electionObserver, plainModule)) == 2
}, announceTimeout, announceTick, "a module without election must publish every instance")
requireRoutingUntouched(require, lastRoutesOf(electionObserver, plainModule), plainHosts())
lateObserver := newClusterEventHandler()
runClusterClient(ctx, require,
newClusterClient(t, lateObserverModule, lateObserverIP, logger),
cluster.NewEventHandler().RequireModule(electionModule, lateObserver).RoutesReceiver(lateObserver),
)
require.Eventually(func() bool {
return slices.Equal(lastHosts(lateObserver), []string{expectedLeader}) &&
routingLeaderOf(lateObserver, electionModule) == expectedLeader
}, announceTimeout, announceTick, "a subscriber connected after the election must see the same leader")
requireRoutingLeader(require, lastRoutesOf(lateObserver, electionModule), expectedLeader)
standbySnapshots := len(electionObserver.ReceivedHosts())
byHost[hostOf(t, elected[2].Address)].disconnect(t)
require.Eventually(func() bool {
return len(electionObserver.ReceivedHosts()) > standbySnapshots
}, announceTimeout, announceTick, "disconnecting a standby must re-emit the address list")
require.Equal([]string{expectedLeader}, lastHosts(electionObserver),
"disconnecting a standby must not move leadership")
leaderSnapshots := len(electionObserver.ReceivedHosts())
byHost[hostOf(t, expectedLeader)].disconnect(t)
require.Eventually(func() bool {
return slices.Equal(lastHosts(electionObserver), []string{expectedSuccessor})
}, announceTimeout, announceTick, "disconnecting the leader must move leadership to the next one in derivation order")
require.Equal(expectedSuccessor, selectLeaderOrder(ctx, testDb, electionModule)[0].Address)
requireRoutingLeader(require, lastRoutesOf(electionObserver, electionModule), expectedSuccessor)
require.Greater(len(electionObserver.ReceivedHosts()), leaderSnapshots,
"disconnecting the leader must re-emit the address list")
lastSnapshots := len(electionObserver.ReceivedHosts())
byHost[hostOf(t, expectedSuccessor)].disconnect(t)
require.Eventually(func() bool {
return len(electionObserver.ReceivedHosts()) > lastSnapshots
}, announceTimeout, announceTick, "disconnecting the last instance must re-emit the address list")
require.Empty(lastHosts(electionObserver), "with no instances left the subscriber must receive an empty list")
require.Empty(selectLeaderOrder(ctx, testDb, electionModule))
require.Eventually(func() bool {
return slices.Equal(lastHosts(plainObserver), selectEmittedAddresses(ctx, testDb, plainModule))
}, announceTimeout, announceTick, "a module without election keeps its newest-first address list")
requireRoutingUntouched(require, lastRoutesOf(plainObserver, plainModule), plainHosts())
requireNoLeaderState(t, testDb)
}
//nolint:paralleltest
func TestModuleLeaderElectionWithoutLeader(t *testing.T) {
require, logger, testDb := setupTestApp(t)
ctx := t.Context()
observer := newClusterEventHandler()
runClusterClient(ctx, require,
newClusterClient(t, noLeaderObserverName, noLeaderObserverIP, logger),
cluster.NewEventHandler().RequireModule(noLeaderModule, observer).RoutesReceiver(observer),
)
byHost := map[string]moduleInstance{
noLeaderHostOne: startModuleInstance(t, noLeaderModule, noLeaderHostOne, cluster.ModuleLeaderModeRequestElection, logger),
noLeaderHostTwo: startModuleInstance(t, noLeaderModule, noLeaderHostTwo, cluster.ModuleLeaderModeRequestElection, logger),
}
require.Eventually(func() bool {
return len(selectLeaderOrder(ctx, testDb, noLeaderModule)) == 2
}, announceTimeout, announceTick, "both instances of %s must be connected", noLeaderModule)
order := selectLeaderOrder(ctx, testDb, noLeaderModule)
require.Eventually(func() bool {
return slices.Equal(lastHosts(observer), []string{order[0].Address})
}, announceTimeout, announceTick, "the leader address must be the only published address")
requireRoutingLeader(require, lastRoutesOf(observer, noLeaderModule), order[0].Address)
byHost[hostOf(t, order[0].Address)].disconnect(t)
var remaining []leaderOrderRow
require.Eventually(func() bool {
remaining = selectLeaderOrder(ctx, testDb, noLeaderModule)
return len(remaining) == 1 && slices.Equal(lastHosts(observer), []string{remaining[0].Address})
}, announceTimeout, announceTick, "leadership must move to the remaining instance")
snapshots := len(observer.ReceivedHosts())
byHost[hostOf(t, remaining[0].Address)].disconnect(t)
require.Eventually(func() bool {
return len(observer.ReceivedHosts()) > snapshots && len(lastHosts(observer)) == 0
}, announceTimeout, announceTick, "with no instances left the subscriber must receive an empty address list")
require.Empty(lastHosts(observer), "the client must receive an empty list, not the previous address")
require.Empty(selectLeaderOrder(ctx, testDb, noLeaderModule))
require.Empty(lastRoutesOf(observer, noLeaderModule), "a module without instances publishes no declaration")
}
func startModuleInstance(
t *testing.T,
moduleName string,
host string,
moduleLeaderMode string,
logger log.Logger,
) moduleInstance {
t.Helper()
cli := newClusterClientFull(t, moduleName, host, testModuleRemoteConfig{}, []byte("{}"), nil, moduleLeaderMode, logger)
ctx, cancel := context.WithCancel(t.Context())
runClusterClient(ctx, require.New(t), cli, cluster.NewEventHandler())
return moduleInstance{host: host, cli: cli, cancel: cancel}
}
func (i moduleInstance) disconnect(t *testing.T) {
t.Helper()
i.cancel()
require.NoError(t, i.cli.Close())
}
func addressOf(host string) string {
return net.JoinHostPort(host, instancePort)
}
func hostOf(t *testing.T, address string) string {
t.Helper()
host, _, err := net.SplitHostPort(address)
require.New(t).NoError(err)
return host
}
func plainHosts() []string {
return []string{addressOf(plainHostOne), addressOf(plainHostTwo)}
}
func lastHosts(handler *clusterEventHandler) []string {
snapshots := handler.ReceivedHosts()
if len(snapshots) == 0 {
return nil
}
return snapshots[len(snapshots)-1]
}
func lastRoutesOf(handler *clusterEventHandler, moduleName string) []cluster.BackendDeclaration {
snapshots := handler.ReceivedRoutes()
if len(snapshots) == 0 {
return nil
}
declarations := make([]cluster.BackendDeclaration, 0)
for _, declaration := range snapshots[len(snapshots)-1] {
if declaration.ModuleName == moduleName {
declarations = append(declarations, declaration)
}
}
return declarations
}
func routingLeaderOf(handler *clusterEventHandler, moduleName string) string {
declarations := lastRoutesOf(handler, moduleName)
if len(declarations) != 1 || !declarations[0].Address.IsModuleLeader {
return ""
}
return addressOf(declarations[0].Address.IP)
}
func requireRoutingLeader(require *require.Assertions, declarations []cluster.BackendDeclaration, leaderAddress string) {
require.Len(declarations, 1, "the routing map of an elected module must publish only the leader")
require.Equal(leaderAddress, addressOf(declarations[0].Address.IP))
require.True(declarations[0].Address.IsModuleLeader, "the leader declaration must carry the leader flag")
}
func requireRoutingUntouched(require *require.Assertions, declarations []cluster.BackendDeclaration, announced []string) {
require.Len(declarations, len(announced), "a module without election must publish every instance")
addresses := make([]string, 0, len(declarations))
for _, declaration := range declarations {
require.False(declaration.Address.IsModuleLeader)
addresses = append(addresses, addressOf(declaration.Address.IP))
}
require.ElementsMatch(announced, addresses)
}
func selectLeaderOrder(ctx context.Context, testDb db.DB, moduleName string) []leaderOrderRow {
rows := make([]leaderOrderRow, 0)
_ = testDb.Select(ctx, &rows, `
select ws_connection_id, address
from isp_config_service__backend
where module_name = ?
order by created_at asc, ws_connection_id asc`, moduleName)
return rows
}
func selectEmittedAddresses(ctx context.Context, testDb db.DB, moduleName string) []string {
rows := selectLeaderOrder(ctx, testDb, moduleName)
addresses := make([]string, 0, len(rows))
for i := range slices.Backward(rows) {
addresses = append(addresses, rows[i].Address)
}
return addresses
}
func requireNoLeaderState(t *testing.T, testDb db.DB) {
t.Helper()
require := require.New(t)
columns := make([]schemaNameRow, 0)
err := testDb.Select(t.Context(), &columns, `pragma table_info('isp_config_service__backend')`)
require.NoError(err)
leaderColumns := make([]string, 0)
for _, column := range columns {
if strings.Contains(strings.ToLower(column.Name), "leader") {
leaderColumns = append(leaderColumns, column.Name)
}
}
require.Equal([]string{"module_leader_mode"}, leaderColumns,
"only the announced mode is stored, the derived leader never is")
objects := make([]schemaNameRow, 0)
err = testDb.Select(t.Context(), &objects, `
select name from sqlite_master
where lower(name) like '%leader%' and type in ('table','view','index','trigger')`)
require.NoError(err)
require.Empty(objects, "leader election must not add a table, view, index, or trigger")
}
+281
View File
@@ -0,0 +1,281 @@
package tests_test
import (
"context"
"slices"
"testing"
"time"
"isp-config-service/domain"
"isp-config-service/service/rqlite/db"
"github.com/stretchr/testify/require"
"github.com/txix-open/isp-kit/cluster"
"github.com/txix-open/isp-kit/errors"
"github.com/txix-open/isp-kit/grpc/client"
"github.com/txix-open/isp-kit/log"
)
const (
electionModule = "election"
noneModule = "none"
leaderModule = "imleader"
followerModule = "imfollower"
garbageModule = "garbage"
observerModule = "observer"
garbageLeaderMode = "SOMETHING_ELSE"
announceTimeout = 20 * time.Second
announceTick = 200 * time.Millisecond
)
// nolint:tagliatelle
type backendRow struct {
WsConnectionId string `json:"ws_connection_id"`
CreatedAt int64 `json:"created_at"`
ModuleLeaderMode *string `json:"module_leader_mode"`
}
// nolint:tagliatelle
type backendCountRow struct {
Total int `json:"total"`
}
// nolint:tagliatelle
type epochAdvancedRow struct {
Advanced int `json:"advanced"`
}
func (r backendRow) moduleLeaderMode() string {
if r.ModuleLeaderMode == nil {
return "null"
}
return *r.ModuleLeaderMode
}
//nolint:funlen,paralleltest
func TestModuleLeaderMode(t *testing.T) {
require, logger, testDb := setupTestApp(t)
ctx := t.Context()
routes := newClusterEventHandler()
runClusterClient(ctx, require,
newClusterClient(t, observerModule, "10.2.9.9", logger),
cluster.NewEventHandler().RoutesReceiver(routes),
)
electionCli := newClusterClientWithLeaderMode(t, electionModule, "10.2.9.1", cluster.ModuleLeaderModeRequestElection, logger)
runClusterClient(ctx, require, electionCli, cluster.NewEventHandler())
noneCli := newClusterClient(t, noneModule, "10.2.9.2", logger)
runClusterClient(ctx, require, noneCli, cluster.NewEventHandler())
leaderCli := newClusterClientWithLeaderMode(t, leaderModule, "10.2.9.3", cluster.ModuleLeaderModeImLeader, logger)
runClusterClient(ctx, require, leaderCli, cluster.NewEventHandler())
followerCli := newClusterClientWithLeaderMode(t, followerModule, "10.2.9.4", cluster.ModuleLeaderModeImFollower, logger)
runClusterClient(ctx, require, followerCli, cluster.NewEventHandler())
garbageCli := newClusterClientWithLeaderMode(t, garbageModule, "10.2.9.5", garbageLeaderMode, logger)
runClusterClient(ctx, require, garbageCli, cluster.NewEventHandler())
electionRow := requireBackendRow(t, testDb, electionModule)
require.Equal(cluster.ModuleLeaderModeRequestElection, electionRow.moduleLeaderMode())
noneRow := requireBackendRow(t, testDb, noneModule)
require.NotNil(noneRow.ModuleLeaderMode, "mode announced as empty must be stored as empty string")
require.Equal(cluster.ModuleLeaderModeNone, noneRow.moduleLeaderMode())
t.Logf("rqlite returns module_leader_mode of %s as %q", noneModule, noneRow.moduleLeaderMode())
reserved := []struct {
moduleName string
cli *cluster.Client
}{
{moduleName: leaderModule, cli: leaderCli},
{moduleName: followerModule, cli: followerCli},
{moduleName: garbageModule, cli: garbageCli},
}
for _, instance := range reserved {
row := requireBackendRow(t, testDb, instance.moduleName)
require.NotNil(row.ModuleLeaderMode, "reserved mode must be stored as empty string")
require.Equal(cluster.ModuleLeaderModeNone, row.moduleLeaderMode(), instance.moduleName)
require.Eventually(func() bool {
return instance.cli.Healthcheck(ctx) == nil
}, announceTimeout, announceTick, "handshake of %s must not be rejected", instance.moduleName)
}
requireAcceptedModules(require, ctx, leaderModule, followerModule, garbageModule)
for _, routing := range requireReceivedRoutes(require, routes) {
for _, declaration := range routing {
// electionModule declared REQUEST_ELECTION: its leader is published with the leader flag set.
if declaration.ModuleName == electionModule {
continue
}
require.False(declaration.Address.IsModuleLeader)
require.Equal(cluster.ModuleLeaderModeNone, declaration.ModuleLeaderMode)
}
}
require.Eventually(func() bool {
return backendCreatedAtPassed(t, testDb, electionModule)
}, announceTimeout, announceTick, "created_at must be older than now to detect a move")
beforeReannounce, err := selectBackendRow(t, testDb, electionModule)
require.NoError(err)
err = electionCli.SendModuleReady(ctx)
require.NoError(err)
reannouncedRow, err := selectBackendRow(t, testDb, electionModule)
require.NoError(err)
require.Equal(beforeReannounce.WsConnectionId, reannouncedRow.WsConnectionId)
require.Equal(beforeReannounce.CreatedAt, reannouncedRow.CreatedAt, "re-announcement must not move the instance")
require.Equal(cluster.ModuleLeaderModeRequestElection, reannouncedRow.moduleLeaderMode())
count := selectBackendCount(t, testDb, electionModule)
require.Equal(1, count.Total)
}
func newClusterClientWithLeaderMode(
t *testing.T,
moduleName string,
host string,
moduleLeaderMode string,
logger log.Logger,
) *cluster.Client {
t.Helper()
return newClusterClientFull(
t,
moduleName,
host,
testModuleRemoteConfig{},
[]byte("{}"),
nil,
moduleLeaderMode,
logger,
)
}
func runClusterClient(
ctx context.Context,
require *require.Assertions,
cli *cluster.Client,
handler *cluster.EventHandler,
) {
go func() {
err := cli.Run(ctx, handler)
require.NoError(err) //nolint:testifylint
}()
}
func selectBackendRow(t *testing.T, testDb db.DB, moduleName string) (backendRow, error) {
t.Helper()
var row backendRow
err := testDb.SelectRow(t.Context(), &row, `
select ws_connection_id, created_at, module_leader_mode
from isp_config_service__backend
where module_name = ?`, moduleName)
if err != nil {
return backendRow{}, errors.WithMessagef(err, "select backend row of module %s", moduleName)
}
return row, nil
}
func requireBackendRow(t *testing.T, testDb db.DB, moduleName string) backendRow {
t.Helper()
require := require.New(t)
var row backendRow
require.Eventually(func() bool {
stored, err := selectBackendRow(t, testDb, moduleName)
if err != nil {
return false
}
row = stored
return true
}, announceTimeout, announceTick, "module %s announcement is not stored", moduleName)
return row
}
func backendCreatedAtPassed(t *testing.T, testDb db.DB, moduleName string) bool {
t.Helper()
var row epochAdvancedRow
err := testDb.SelectRow(t.Context(), &row, `
select unixepoch() > created_at as advanced
from isp_config_service__backend
where module_name = ?`, moduleName)
return err == nil && row.Advanced == 1
}
func selectBackendCount(t *testing.T, testDb db.DB, moduleName string) backendCountRow {
t.Helper()
row := backendCountRow{}
err := testDb.SelectRow(t.Context(), &row, `
select count(*) as total
from isp_config_service__backend
where module_name = ?`, moduleName)
require.New(t).NoError(err)
return row
}
func requireAcceptedModules(require *require.Assertions, ctx context.Context, moduleNames ...string) {
apiCli, err := client.Default()
require.NoError(err)
apiCli.Upgrade([]string{"127.0.0.1:9002"})
modules := make([]domain.ModuleInfo, 0)
require.Eventually(func() bool {
modules = modules[:0]
err = apiCli.Invoke("config/module/get_modules_info").
JsonResponseBody(&modules).
Do(ctx)
if err != nil {
return false
}
connected := make([]string, 0, len(modules))
for _, module := range modules {
connected = append(connected, module.Name)
}
for _, moduleName := range moduleNames {
if !slices.Contains(connected, moduleName) {
return false
}
}
return true
}, announceTimeout, announceTick, "announced modules must be visible in modules info")
for _, moduleName := range moduleNames {
module := findModule(modules, moduleName)
require.NotNil(module, moduleName)
require.Len(module.Status, 1, moduleName)
}
}
func findModule(modules []domain.ModuleInfo, moduleName string) *domain.ModuleInfo {
for i := range modules {
if modules[i].Name == moduleName {
return &modules[i]
}
}
return nil
}
func requireReceivedRoutes(require *require.Assertions, handler *clusterEventHandler) []cluster.RoutingConfig {
require.Eventually(func() bool {
return len(handler.ReceivedRoutes()) > 0
}, announceTimeout, announceTick, "routing configuration must be received")
return handler.ReceivedRoutes()
}
+89
View File
@@ -124,6 +124,95 @@ func TestVariableAcceptance(t *testing.T) {
require.Empty(allResponse[1].Value) // secret
}
//nolint:funlen,paralleltest
func TestVariableLinksAfterConfigUpdate(t *testing.T) {
require := require.New(t)
logger := setupTest(t)
apiCli, err := client.Default()
require.NoError(err)
apiCli.Upgrade([]string{"127.0.0.1:9002"})
err = apiCli.Invoke("config/variable/create").
JsonRequestBody(domain.CreateVariableRequest{
Name: "linkVar",
Description: "test",
Type: "TEXT",
Value: fake.It[string](),
}).
Do(t.Context())
require.NoError(err)
type linkTestConfig struct {
Addr string
Alias string
}
clientC := newClusterClientWith(
t,
"LinkTestModule",
"10.2.9.77",
linkTestConfig{},
[]byte(`{"addr":"init","alias":"init"}`),
nil,
logger,
)
go func() {
handler := cluster.NewEventHandler()
err := clientC.Run(t.Context(), handler)
require.NoError(err) //nolint:testifylint
}()
time.Sleep(2 * time.Second)
activeConfig := domain.Config{}
err = apiCli.Invoke("config/config/get_active_config_by_module_name").
JsonRequestBody(domain.GetByModuleNameRequest{ModuleName: "LinkTestModule"}).
JsonResponseBody(&activeConfig).
Do(t.Context())
require.NoError(err)
// The same variable is referenced twice in the config data.
err = apiCli.Invoke("config/config/create_update_config").
JsonRequestBody(domain.CreateUpdateConfigRequest{
Id: activeConfig.Id,
Name: activeConfig.Name,
ModuleId: activeConfig.ModuleId,
Version: activeConfig.Version,
Data: []byte(`{"addr":"_Var(linkVar)","alias":"prefix/_Var(linkVar)"}`),
}).
Do(t.Context())
require.NoError(err)
varResponse := []domain.Variable{}
err = apiCli.Invoke("config/variable/all").
JsonResponseBody(&varResponse).
Do(t.Context())
require.NoError(err)
require.Len(varResponse, 1)
require.Equal("linkVar", varResponse[0].Name)
require.Len(varResponse[0].ContainsInConfigs, 1)
require.Equal(activeConfig.Id, varResponse[0].ContainsInConfigs[0].Id)
// Re-saving identical config data must keep the links.
err = apiCli.Invoke("config/config/create_update_config").
JsonRequestBody(domain.CreateUpdateConfigRequest{
Id: activeConfig.Id,
Name: activeConfig.Name,
ModuleId: activeConfig.ModuleId,
Version: activeConfig.Version,
Data: []byte(`{"alias":"prefix/_Var(linkVar)","addr":"_Var(linkVar)"}`),
}).
Do(t.Context())
require.NoError(err)
varResponse = []domain.Variable{}
err = apiCli.Invoke("config/variable/all").
JsonResponseBody(&varResponse).
Do(t.Context())
require.NoError(err)
require.Len(varResponse[0].ContainsInConfigs, 1)
require.Equal(activeConfig.Id, varResponse[0].ContainsInConfigs[0].Id)
}
func unmarshalConfig(require *require.Assertions, configData []byte) configWithVars {
firstConfig := configWithVars{}
err := json.Unmarshal(configData, &firstConfig)