DevOps · Flashcard

What does defragmentation do in etcd?

  • AReleases the free space left after compaction — returning it from the backend file to the filesystem
  • BRemoves old key revisions from history — reclaiming the space that stale versions were using
  • CRebalances keys across members — evening out how much data each node in the cluster stores
  • DReorders keys on disk by access frequency — putting hot keys first to speed up future reads

Why this is the answer

Compaction frees revisions internally but leaves the backend file the same size; defrag actually shrinks that file and returns space to the filesystem. It does not itself delete revisions (that is compaction), does not move data between members, and does not reorder keys by access pattern.

Official docs
Study in Gnoseed →