Skip to content

cli: temp dir should be cleared before disk full warning on startup #85147

@1lann

Description

@1lann

Currently, if CockroachDB is run with the --temp-dir being on the same disk as --store and an intensive operation is ran that spills to disk more than the available remaining disk capacity, CockroachDB will not automatically recover by clearing out the temporary directory on next start even if doing so would be sufficient to clear out the out of disk state. It would be ideal if it could as to prevent us from needing to manually delete the temporary files.

To Reproduce

  1. Run CockroachDB without a specified --temp-dir so it defaults to the --store location, and a --max-disk-temp-storage more than the available remaining disk capacity.
  2. Run an intensive query that spills to disk more than the remaining disk capacity.
  3. CockroachDB crashes with exit code 10 (as expected when it runs out of disk).
  4. On restart, CockroachDB fails fast with the error message that the disk is out of space, even though if it were to clear the --temp-dir it would have enough space to start.

Expected behavior

  1. Run CockroachDB without a specified --temp-dir so it defaults to the --store location, and a --max-disk-temp-storage more than the available remaining disk capacity.
  2. Run an intensive query that spills to disk more than the remaining disk capacity.
  3. CockroachDB crashes with exit code 10 (as expected when it runs out of disk).
  4. On restart, CockroachDB clears the --temp-dir and then checks if the disk is out of space, in which it finds it isn't, and starts normally.

Environment:

  • CockroachDB version: 22.1.4
  • Server OS: Docker image on amd64 Linux
  • Client app: N/A

Jira issue: CRDB-18064

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-cli-serverCLI commands that pertain to CockroachDB server processesA-orchestrationRelating to orchestration systems like KubernetesA-storageRelating to our storage engine (Pebble) on-disk storage.C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)E-easyEasy issue to tackle, requires little or no CockroachDB experienceE-quick-winLikely to be a quick win for someone experienced.E-starterMight be suitable for a starter project for new employees or team members.O-sreFor issues SRE opened or otherwise cares about tracking.T-storageStorage Team

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions