Skip to content

feat: implement LID block size config#405

Open
cheb0 wants to merge 4 commits into
mainfrom
330-lid-block-size-config
Open

feat: implement LID block size config#405
cheb0 wants to merge 4 commits into
mainfrom
330-lid-block-size-config

Conversation

@cheb0
Copy link
Copy Markdown
Collaborator

@cheb0 cheb0 commented Apr 17, 2026

Description

Allow to configure LID block size.

Fixes #330


@github-actions
Copy link
Copy Markdown
Contributor

PR Title Validation Failed
Please refer to CONTRIBUTING.md

@cheb0 cheb0 force-pushed the 330-lid-block-size-config branch from d8f7ee7 to 7e69736 Compare April 17, 2026 11:36
@github-actions
Copy link
Copy Markdown
Contributor

PR Title Validation Failed
Please refer to CONTRIBUTING.md

@cheb0 cheb0 force-pushed the 330-lid-block-size-config branch from 7e69736 to f781743 Compare April 17, 2026 11:44
@github-actions
Copy link
Copy Markdown
Contributor

PR Title Validation Failed
Please refer to CONTRIBUTING.md

@cheb0 cheb0 changed the title feat: LID block size config feat: implement LID block size config Apr 17, 2026
@eguguchkin eguguchkin added this to the v0.73.0 milestone Apr 20, 2026
@eguguchkin eguguchkin requested review from dkharms, eguguchkin and moflotas and removed request for moflotas April 20, 2026 09:51
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 45.00000% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.58%. Comparing base (e0cf437) to head (c81db1f).

Files with missing lines Patch % Lines
config/validation.go 50.00% 4 Missing and 1 partial ⚠️
cmd/seq-db/seq-db.go 0.00% 2 Missing ⚠️
frac/active.go 0.00% 1 Missing and 1 partial ⚠️
frac/sealed/sealing/blocks_builder.go 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #405      +/-   ##
==========================================
- Coverage   70.65%   70.58%   -0.07%     
==========================================
  Files         219      219              
  Lines       16967    16985      +18     
==========================================
+ Hits        11988    11989       +1     
- Misses       4084     4096      +12     
- Partials      895      900       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread config/config.go
SealedZstdCompressionLevel int `config:"sealed_zstd_compression_level" default:"3"`
DocBlockZstdCompressionLevel int `config:"doc_block_zstd_compression_level" default:"3"`
// LIDBlockSize sets max lids (postings) saved per LIDs block.
LIDBlockSize Bytes `config:"lid_block_size" default:"64KiB"`
Copy link
Copy Markdown
Member

@dkharms dkharms May 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to get rid of this nonsense with Bytes because we do not build blocks by examining size of block but just by examining count of LIDs inside a block:

for _, lid := range lidsbuf {
	// Flush if there is more LIDs than specified threshold.
	if len(a.currentBlock.payload.LIDs) == a.blockCapacity {
		if err := a.onBlock(a.finalizeBlock()); err != nil {
			return err
		}

		a.currentBlock.payload.LIDs = a.currentBlock.payload.LIDs[:0]
		...
	}

	...
}

Migration is gonna be painless since this is how we store this information in .info file:

seq-db ⟩ cat /tmp/tmp.mCJYmApMn2/seq-db-01KREF7BBEPZ0KB0HZZ1CCKP33.info
SEQM{..., "const_lid_block_cap":65536, ...}

What do you think? This is bugging me for a very long time, honestly.

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.

Configurable block sizes in sealed fraction

4 participants