Skip to content

feat: per-group configuration with global config table#32

Merged
YuweiXiao merged 4 commits intomainfrom
worktree-group-level-config
Mar 17, 2026
Merged

feat: per-group configuration with global config table#32
YuweiXiao merged 4 commits intomainfrom
worktree-group-level-config

Conversation

@YuweiXiao
Copy link
Copy Markdown
Collaborator

Summary

  • Add duckpipe.global_config key-value table and sync_groups.config JSONB column for per-group config overrides
  • Resolution order: hardcoded defaults ← global_config rows ← per-group JSONB
  • 5 config keys: duckdb_memory_limit, duckdb_threads, flush_interval_ms, flush_batch_threshold, max_queued_changes
  • 4 SQL API functions: set_config, get_config, set_group_config, get_group_config with key/value validation
  • FlushWorker now applies SET memory_limit / SET threads from resolved config
  • Remove 3 GUCs (flush_interval, flush_batch_threshold, max_queued_changes) and 3 daemon CLI args — replaced by config tables
  • New GroupConfig (serde, Option fields) and ResolvedConfig types in duckpipe-core

Test plan

  • New group_config regression test: defaults, set/get global, set/get per-group, resolution, invalid key/value errors, nonexistent group errors
  • All 32 existing regression tests pass (make installcheck)
  • cargo check compiles cleanly
  • cargo fmt applied

🤖 Generated with Claude Code

@YuweiXiao YuweiXiao force-pushed the worktree-group-level-config branch 2 times, most recently from 6fc4709 to 918171e Compare March 16, 2026 10:12
YuweiXiao and others added 4 commits March 17, 2026 12:51
Replace 3 GUCs (flush_interval, flush_batch_threshold, max_queued_changes)
and corresponding daemon CLI args with a table-based config system that
supports per-group overrides.

- Add `duckpipe.global_config` key-value table seeded with defaults
- Add `sync_groups.config` JSONB column for per-group overrides
- Resolution order: hardcoded defaults ← global_config ← per-group JSONB
- New config keys: duckdb_memory_limit, duckdb_threads, flush_interval_ms,
  flush_batch_threshold, max_queued_changes
- FlushWorker now applies SET memory_limit / SET threads from resolved config
- SQL API: set_config, get_config, set_group_config, get_group_config
- GroupConfig/ResolvedConfig types with serde, validation, resolution logic

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove redundant flush_batch_threshold/flush_interval_ms scalar fields
  from FlushCoordinator (read from resolved_config directly)
- Remove dead _resolved_config param from do_flush_buffer
- Add ResolvedConfig::to_group_config() and get_key() helper methods
- Use helpers in get_group_config to eliminate manual field matching
- Fix set_group_config race with SELECT ... FOR UPDATE
- Add audit logging for set_config and set_group_config
- Change default flush_interval_ms to 5000, flush_batch_threshold to 50000
- Override fast flush values in auto_start test for CI

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
max_concurrent_flushes is now part of the config table system
(global_config + per-group JSONB overrides) instead of being a
separate PostgreSQL GUC. This allows different sync groups to have
different concurrency limits.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- group_config.out: add max_concurrent_flushes to table listing, JSON
  outputs, and error messages (7 rows instead of 6)
- regression.conf: remove dead duckpipe.flush_interval GUC (now managed
  via global_config table)
- daemon helpers.sh: replace removed --flush-interval/--flush-batch-threshold
  CLI args with SQL-based duckpipe.set_config() calls
- api.rs: add max_concurrent_flushes to hardcoded valid keys error message

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@YuweiXiao YuweiXiao force-pushed the worktree-group-level-config branch from 6f95a2b to 64b9755 Compare March 17, 2026 05:04
@YuweiXiao YuweiXiao merged commit d649fcc into main Mar 17, 2026
1 of 3 checks passed
@YuweiXiao YuweiXiao deleted the worktree-group-level-config branch March 17, 2026 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant