Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bench/engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
struct BenchEngine {
virtual ~BenchEngine() = default;
// full_fsync: on macOS, sync writes push through the drive cache
// (F_FULLFSYNC) RocksDB always does this for sync=true there, so the
// (F_FULLFSYNC) - RocksDB always does this for sync=true there, so the
// apples-to-apples sync comparison needs strata in the same mode.
virtual bool open(const std::string& dir, bool sync_writes, bool full_fsync,
std::string* err) = 0;
Expand Down
4 changes: 2 additions & 2 deletions fuzz/fuzz_sstable.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// libFuzzer target: arbitrary bytes as an SSTable. Open, point-get, and full
// iteration must parse or reject never crash, over-read, or loop forever.
// iteration must parse or reject - never crash, over-read, or loop forever.
// Every block is CRC-guarded, so most mutations die at open; to reach the
// block/index/filter parsers, mutated tables produced by the seed corpus
// (real tables) matter see fuzz/run_fuzz.sh which seeds from unit-test
// (real tables) matter - see fuzz/run_fuzz.sh which seeds from unit-test
// artifacts.

#include <cstdint>
Expand Down
4 changes: 2 additions & 2 deletions fuzz/fuzz_wal.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// libFuzzer target: arbitrary bytes as a WAL file. The reader must parse or
// reject never crash, over-read, or accept a record whose CRC does not
// reject - never crash, over-read, or accept a record whose CRC does not
// match. Records that do parse must satisfy the WriteBatch structural check
// contract the recovery path relies on (check() is called on every replayed
// record, so a batch that parses here but fails check() is fine what must
// record, so a batch that parses here but fails check() is fine - what must
// hold is that neither step trips ASan/UBSan).

#include <cstdint>
Expand Down
4 changes: 2 additions & 2 deletions src/db/db_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Status DBImpl::init() {

// ===========================================================================
// Recovery (docs/DESIGN.md §1.3): replay every record of every WAL >=
// min_wal_number no sequence filtering.
// min_wal_number - no sequence filtering.
// ===========================================================================

Status DBImpl::recover_wal_files() {
Expand Down Expand Up @@ -143,7 +143,7 @@ Status DBImpl::recover_wal_files() {
s = WriteBatchInternal::check(Slice(record));
if (!s.ok()) {
// CRC-valid but structurally bad: real corruption, not a torn
// tail refuse to guess.
// tail - refuse to guess.
return s;
}
WriteBatch batch;
Expand Down
2 changes: 1 addition & 1 deletion src/db/dbformat.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class InternalKey {
std::string rep_;
};

// Memtable probe key. Layout: varint32(klen) | user_key | tag so
// Memtable probe key. Layout: varint32(klen) | user_key | tag - so
// memtable_key() is a full skiplist entry prefix and internal_key() is the
// embedded internal key.
class LookupKey {
Expand Down
2 changes: 1 addition & 1 deletion src/db/memtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace strata {

// Arena-backed sorted run of internal-key entries. Held by shared_ptr:
// the DB (as active or immutable), the flush job, and every in-flight
// read/iterator keep it and therefore its arena alive.
// read/iterator keep it - and therefore its arena - alive.
//
// Entry layout in the arena:
// varint32 internal_key_len | user_key | fixed64 tag | varint32 vlen | value
Expand Down
2 changes: 1 addition & 1 deletion src/db/version.cc
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ void Version::overlapping_inputs(int level, const Slice& begin_ukey, const Slice
namespace {

// Probes one table file for the lookup key. Returns true when the search is
// decided (found / tombstone / error) false means "keep looking deeper".
// decided (found / tombstone / error) - false means "keep looking deeper".
bool probe_file(TableCache* tc, const InternalKeyComparator* /*icmp*/, const FileMeta& f,
const LookupKey& lkey, std::string* value, Status* result) {
std::shared_ptr<TableReader> reader;
Expand Down
2 changes: 1 addition & 1 deletion src/table/block.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace strata {

// Read side of a prefix-compressed block. Contents are CRC-verified before
// construction, but the parser still treats every byte as adversarial
// (bounds-checked varints, restart offsets validated) fuzz_sstable feeds
// (bounds-checked varints, restart offsets validated) - fuzz_sstable feeds
// arbitrary bytes through here.
class Block {
public:
Expand Down
2 changes: 1 addition & 1 deletion src/table/bloom.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ std::uint64_t bloom_hash(const Slice& key);
void bloom_build(const std::vector<std::uint64_t>& hashes, int bits_per_key, std::string* dst);

// True if the key may be present; false only if definitely absent. An
// undersized/garbage filter returns true (fail open correctness never
// undersized/garbage filter returns true (fail open - correctness never
// depends on the filter).
bool bloom_may_contain(const Slice& filter, std::uint64_t hash);

Expand Down
2 changes: 1 addition & 1 deletion src/table/table_builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace strata {

// Writes an SSTable (docs/DESIGN.md §1.1). Caller syncs + closes the file
// after finish() the durability ordering lives in the flush/compaction
// after finish() - the durability ordering lives in the flush/compaction
// code, not here.
class TableBuilder {
public:
Expand Down
2 changes: 1 addition & 1 deletion src/util/cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace strata {

// Sharded LRU cache for uncompressed data blocks. Keys are
// (sstable file number, block offset) packed into 64 bits; SSTables are
// immutable, so there is no invalidation entries for deleted files simply
// immutable, so there is no invalidation - entries for deleted files simply
// age out. Values are shared_ptr so a block stays alive while any iterator
// still points into it, even after eviction.
class BlockCache {
Expand Down
2 changes: 1 addition & 1 deletion src/util/random.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace strata {

// xorshift64* deterministic given a seed; used for skiplist heights and
// xorshift64* - deterministic given a seed; used for skiplist heights and
// test workloads (never for anything security-sensitive).
class Random {
public:
Expand Down
2 changes: 1 addition & 1 deletion src/wal/wal_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace strata {

// Replays a WAL segment. Stops at the first torn/corrupt record (treated as
// the tail, per docs/DESIGN.md §1.2) a bad record is never returned.
// the tail, per docs/DESIGN.md §1.2) - a bad record is never returned.
class WalReader {
public:
// expected_uuid == 0 skips the UUID check (used before the MANIFEST's
Expand Down
2 changes: 1 addition & 1 deletion src/wal/wal_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class WalWriter {
Status add_record(const Slice& payload);

// add_record runs with the DB mutex RELEASED (group-commit leader), and
// the interval-fsync tick calls sync() concurrently mu_ keeps the
// the interval-fsync tick calls sync() concurrently - mu_ keeps the
// WritableFile's buffer single-writer. A sync must never observe (and
// flush) a half-appended record.
Status sync(bool full_fsync) {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/table_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ TEST_F(TableTest, BloomFilterFalsePositiveRateReasonable) {
}

// Flip every byte of a small table: reads must never crash and never return
// a wrong value every flip is either detected or lands in a region whose
// a wrong value - every flip is either detected or lands in a region whose
// bytes don't matter (there are none by design).
TEST_F(TableTest, EveryByteFlipIsDetected) {
const auto contents = make_contents(50);
Expand Down
2 changes: 1 addition & 1 deletion test/unit/wal_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ TEST_F(WalTest, BadMagicRejected) {
}

// The core torn-write property: truncate the log at EVERY byte offset and
// verify recovery yields an exact record prefix never garbage, never a
// verify recovery yields an exact record prefix - never garbage, never a
// partial record.
TEST_F(WalTest, TruncateAtEveryByteYieldsExactPrefix) {
const std::vector<std::string> payloads = {"first-record", "second-record",
Expand Down
12 changes: 6 additions & 6 deletions tools/crash_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
// Each iteration forks a child workload process. The child performs a
// deterministic op stream derived from (seed, op index) and acknowledges
// each op by appending a line to an ack FILE (O_APPEND + raw write(2)) AFTER
// DB::write returns a file, not a pipe, because appended bytes survive
// DB::write returns - a file, not a pipe, because appended bytes survive
// SIGKILL in the page cache and there is no fd-inheritance to race between
// concurrently forking workers. The parent kills the child with a real
// SIGKILL either at a random byte offset inside a write(2) (via the Env
// SIGKILL - either at a random byte offset inside a write(2) (via the Env
// fault-injection choke point, STRATA_CRASH_AT_BYTES) or at a random
// wall-clock time waits for it, reads the acks, reopens the database
// wall-clock time - waits for it, reads the acks, reopens the database
// in-process and asserts:
// A every acknowledged op survives,
// B every recovered value verifies its embedded checksum,
// C the recovered state equals the model at EXACTLY the acked prefix or
// the acked prefix + the single in-flight op (single-writer child), so
// recovery is a prefix nothing torn, nothing resurrected, nothing
// recovery is a prefix - nothing torn, nothing resurrected, nothing
// reordered.
// chain mode keeps the same directory across kills (crash -> recover ->
// continue), landing kills inside flush/compaction of real recovered state.
Expand Down Expand Up @@ -110,7 +110,7 @@ void apply_to_model(std::map<std::string, std::string>* model, std::uint64_t see
// flock() lives on the open file description, so a concurrent worker's
// fork()->exec() window briefly co-owns our LOCK fd (CLOEXEC releases it at
// exec). That transient Busy is a multi-process-harness artifact, not an
// engine defect retry through it.
// engine defect - retry through it.
Status open_with_retry(const Options& options, const std::string& dir, DB** db) {
Status s;
for (int attempt = 0; attempt < 200; ++attempt) {
Expand Down Expand Up @@ -342,7 +342,7 @@ IterationResult run_iteration(const IterationConfig& cfg) {
return result;
}
}
// Assertion B: every surfaced value must verify its embedded checksum
// Assertion B: every surfaced value must verify its embedded checksum -
// a torn record accepted anywhere would fail here.
for (const auto& [key, value] : actual) {
unsigned long long vseed, vi;
Expand Down
Loading