8000 Implement Background SSTable Compaction Support by imprvhub · Pull Request #22 · tidesdb/tidesdb-python · GitHub
[go: up one dir, main page]

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

Implement Background SSTable Compaction Support #22

Draft
wants to merge 1 commit into
base: refactor/cfoundation-setup-process
Choose a base branch
from

Conversation

imprvhub
Copy link
Collaborator
@imprvhub imprvhub commented Jan 14, 2025

Overview

This pull request introduces support for background SSTable compaction in TidesDB. The following changes have been made:

  • Background Compaction: A new method, start_background_partial_merge, was added to handle background compaction. This allows the database to automatically merge SSTables in the background, reducing their count.

  • Monitoring: A new sample script, compaction_operations.py, was added to demonstrate and monitor the background compaction process. It tracks SSTable sizes, file counts, and the compaction progress.

  • Unit Tests: Tests for background compaction functionality were implemented in test_compaction.py to ensure reliability.

Current Status

  • Implemented: Background SSTable compaction functionality and monitoring.
  • Pending: Manual compaction support. This will be implemented soon.

Pending

  • Implement manual compaction to allow users to trigger compaction manually in addition to background compaction.

Additional Note on Stability

While background compaction works correctly across all tested use cases, we've identified a stability issue that requires further investigation:

A segmentation fault occurs at the completion of compaction_operations.py execution
The fault appears to be isolated to the cleanup phase and doesn't affect the compaction operation itself
Issue tracking: After successful compaction operations, the script terminates with zsh: segmentation fault python compaction_operations.py

#19

- Added background SSTable compaction functionality to core.py, including the `start_background_partial_merge` method.
- Introduced a monitoring script for background compaction in `samples/compaction_operations.py`.
- Added unit tests for background compaction in `tests/test_compaction.py`.
- Added functions for compacting SSTables and starting background compaction, along with error handling.
- Still pending: Manual Compaction Support.

#19
@imprvhub imprvhub requested a review from guycipher January 14, 2025 08:34
@imprvhub imprvhub self-assigned this Jan 14, 2025
@imprvhub imprvhub added enhancement New feature or request implementation labels Jan 14, 2025
@imprvhub imprvhub linked an issue Jan 14, 2025 that may be closed by this pull request
@guycipher
Copy link
Member

Did you solve the segfault issue or is it still apparent? Also were you making sure to use latest master of TidesDB?

@imprvhub
Copy link
Collaborator Author
imprvhub commented Jan 14, 2025

Did you solve the segfault issue or is it still apparent? Also were you making sure to use latest master of TidesDB?

@guycipher Always using the latest till its fresh setup every time i test before pr. Segfault its not solved yet, indeed i should specify that in this craft. But at least background compaction its working properly in all uses cases.

@imprvhub imprvhub added good first issue Good for newcomers help wanted Extra attention is needed labels Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement SSTable Compaction Support
2 participants
0