Re-parallelize full signing#630
Open
bal-e wants to merge 5 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a relatively simple implementation for parallelized RRSIG generation.
To recap: we would ideally take the unsigned records (which are sorted in DNSSEC canonical order), split them into arbitrary chunks, and then sign each chunk. But (currently) we sign each chunk using
sign_sorted_zone_records(), which expects to receive the full zone and sign it serially. To work around this, we need to find chunks thatsign_sorted_zone_records()can correctly consume. More specifically, we need to find valid boundaries between chunks. The primary complication here is from zone cuts;sign_sorted_zone_records()will traverse the records it is given, look for zone cuts, and ignore any records below those cuts.In this PR, valid boundaries are defined based on top-level labels; the last label before the zone apex within record owners. For example, the records
foo.example.org,a.foo.example.org, andbar.example.org(in the zoneexample.org) have top-level labelsfoo,foo, andbar, respectively. I have defined valid chunk boundaries to lie between top-level labels, so thatfoo.example.organda.foo.example.orgcannot have a boundary between them, buta.foo.example.organdbar.example.orgcan.This is a good definition with respect to performance because big TLDs (where parallelization matters most) will tend to have many distinct top-level labels. I believe it is sound because zone cuts never extend across top-level labels.
Future considerations
We may unify the implementation and parallelization of the low-level cryptographic signing between the incremental and full signer, with some kind of signing backend. This should be orthogonal to the chunk detection algorithm here.
We may change the zone data structures to separate glue records and authoritative records. This would eliminate the need for this chunk boundary algorithm -- we could traverse over only the authoritative records, and then valid chunk boundaries would just be RRset (or perhaps owner name) boundaries.
Cargo.*,crates/,etc/,integration-tests/,src/):actthrough theact-wrapper(as described inTESTING.md)?