cockroachdb / cockroachdb/pebble

compaction: Add tests for untested compaction error paths

Open
#1,844 1 comment 0 reactions 0 assignees View on GitHub
A-storage C-cleanup E-quick-win T-storage
Dominant language
Go
Stars
6k
Forks
584
Avg merge
16h 35m
Merged PRs (30d)
5

Description

Currently, there are two TODOs in compaction.go around untested code paths,
both concerning errors from `logAndApply`:

https://github.com/cockroachdb/pebble/blob/a4f88b796aeb07156512564261dd32ecadc80de6/compaction.go#L1605

https://github.com/cockroachdb/pebble/blob/a4f88b796aeb07156512564261dd32ecadc80de6/compaction.go#L2086

Errors in logAndApply are possible (eg. errors during Manifest write or Manifest rotation),
so we should be testing these error paths in compactions as well. This can be done
by injecting an error on some Manifest writes (maybe during some metamorphic tests
or in a unit test specifically around manifest error) and ensuring that Pebble continues to return
consistent results and does not panic over it.

Jira issue: PEBBLE-166

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.