Skip to content

Batch NS glue record lookups#132

Open
poyrazK wants to merge 3 commits intomainfrom
release/glue-record-batching
Open

Batch NS glue record lookups#132
poyrazK wants to merge 3 commits intomainfrom
release/glue-record-batching

Conversation

@poyrazK
Copy link
Copy Markdown
Owner

@poyrazK poyrazK commented May 3, 2026

Summary

  • Add GetRecordsByNames() to DNSRepository interface for batch fetching records by multiple names
  • Implement GetRecordsByNames() in PostgresRepository using WHERE LOWER(name) IN (...) query
  • Update authority section handling to batch-fetch all glue A records in a single query instead of N queries

Changes

  • internal/adapters/repository/postgres.go — new GetRecordsByNames() method
  • internal/core/ports/ports.go — interface addition
  • internal/dns/server/server.go — batch glue lookups
  • Test mocks updated to satisfy interface

poyrazK added 3 commits May 3, 2026 21:49
Add GetRecordsByNames() to DNSRepository interface and PostgresRepository
implementation to fetch records for multiple names in a single query.
This eliminates the N+1 query problem when fetching glue A records for
authority section NS records.
Update authority section handling to collect all NS host targets first,
then batch-fetch all glue A records in a single GetRecordsByNames call.
Reduces N DB queries to 1 query regardless of NS record count.
Implement GetRecordsByNames in all test mock repositories to satisfy
the updated DNSRepository interface.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 3, 2026

Warning

Rate limit exceeded

@poyrazK has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 55 minutes and 37 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 706aeef6-da44-4dc0-9077-5471b5c9058b

📥 Commits

Reviewing files that changed from the base of the PR and between 94778bd and 155f13e.

📒 Files selected for processing (8)
  • internal/adapters/repository/postgres.go
  • internal/core/ports/ports.go
  • internal/core/services/dns_service_test.go
  • internal/core/services/dnssec_service_test.go
  • internal/dns/server/chaos_test.go
  • internal/dns/server/server.go
  • internal/dns/server/server_test.go
  • internal/testutil/mock_repo.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch release/glue-record-batching

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 55 minutes and 37 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

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