Skip to content

db: make DB.Ingest return bytes ingested into L0  #1600

@sumeerbhola

Description

@sumeerbhola

This is needed for improvements to admission control that will use byte based tokens, that is part of cockroachdb/cockroach#75066 (see the prototype code in https://github.com/cockroachdb/cockroach/blob/ec4149e310f9b383f87cc7ff8776258d72927394/pkg/util/admission/work_queue.go#L911).
This is complicated by #25, since the actual placement into a Version will be asynchronously done. However, it is viable to produce an estimate at the time of Ingest based on the current spans of L0 files and memtables. This may be an over-estimate since (a) a memtable can be split into multiple sstables when flushing, and an ingested sstable may be able to slip through a gap, (b) an overlapping L0 file may get compacted down to Lbase by the time the ingest is applied to produce a new Version. An estimate is acceptable for admission control.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions