Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Enhanced snapshot compaction based on events size #591

Open
shreyas-s-rao opened this issue May 3, 2023 · 1 comment
Open
Assignees
Labels
area/control-plane Control plane related area/performance Performance (across all domains, such as control plane, networking, storage, etc.) related area/robustness Robustness, reliability, resilience related area/storage Storage related kind/enhancement Enhancement, improvement, extension lifecycle/rotten Nobody worked on this for 12 months (final aging stage) priority/1 Priority (lower number equals higher priority)

Comments

@shreyas-s-rao
Copy link
Contributor

Feature (What you would like to be added):
Smarter snapshot compaction based on events size.

Motivation (Why is this needed?):
Snapshot compaction today is based purely on the number of etcd events recorded in the delta snapshots, based on which druid takes the decision to trigger a compaction job for compacting the latest set of delta snapshots into the latest full snapshot. This approach does not consider the size of the events recorded by the delta snapshots. Events can be quite large, upto 1.5 MB which is the default threshold for event size defined by etcd.

To put things in perspective, the default etcd events threshold for druid is 1 million events. In the worst case, if each event is 1.5 MB large, then the total size of accumulated delta snapshots can go up to 1.5 million MB, ie, 1.5 TB. Compacting this kind of backup is practically impossible due to the following reasons:

  1. During restoration as part of compaction, the etcd does not support this scale of data since the DB is not defragmented during restoration
  2. Even if the DB size is kept in check during restoration with the use of multiple defragmentations while applying the events to the etcd, the amount of time it takes to compact such a DB is impractically large
  3. Letting the backup size blow up means a very long restoration time in case of an actual restoration upon a PV corruption

We cannot rely on the number of etcd events alone to trigger snapshot compactions.

Approach/Hint to the implement solution (optional):
Druid should also consider the total size of the accumulated events and trigger compaction after a certain (configurable) threshold is reached. For druid to get this information, it must depend on the EtcdMember[State] resource using which the backup-restore sidecar publishes snapshot information for druid to consume and act upon.

@shreyas-s-rao shreyas-s-rao added area/control-plane Control plane related area/performance Performance (across all domains, such as control plane, networking, storage, etc.) related area/robustness Robustness, reliability, resilience related area/storage Storage related kind/enhancement Enhancement, improvement, extension priority/1 Priority (lower number equals higher priority) labels May 3, 2023
@shreyas-s-rao
Copy link
Contributor Author

/assign @abdasgupta

@unmarshall unmarshall changed the title [Feature] Smarter snapshot compaction based on events size [Feature] Improved snapshot compaction based on events size Jul 21, 2023
@unmarshall unmarshall changed the title [Feature] Improved snapshot compaction based on events size [Feature] Enhanced snapshot compaction based on events size Jul 21, 2023
@gardener-robot gardener-robot added the lifecycle/stale Nobody worked on this for 6 months (will further age) label Apr 1, 2024
@gardener-robot gardener-robot added lifecycle/rotten Nobody worked on this for 12 months (final aging stage) and removed lifecycle/stale Nobody worked on this for 6 months (will further age) labels Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/control-plane Control plane related area/performance Performance (across all domains, such as control plane, networking, storage, etc.) related area/robustness Robustness, reliability, resilience related area/storage Storage related kind/enhancement Enhancement, improvement, extension lifecycle/rotten Nobody worked on this for 12 months (final aging stage) priority/1 Priority (lower number equals higher priority)
Projects
None yet
Development

No branches or pull requests

3 participants