-
Notifications
You must be signed in to change notification settings - Fork 5
Add first version of write-ahead log #376
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
Merged
Merged
Changes from all commits
Commits
Show all changes
118 commits
Select commit
Hold shift + click to select a range
7b25cc6
Added basic structure for write-ahead-log
CGodiksen 2401f86
Add try_new method to WriteAheadLogFile
CGodiksen f17390e
Add try_new method to WriteAheadLog
CGodiksen b7e688a
Add method to get location of DataFolder
CGodiksen ab01fb6
Add write-ahead log to context
CGodiksen fa57835
Fix bug causing an error if the log folder already exists and ensurin…
CGodiksen cd15223
Add InvalidState to ModelarDbStoreError
CGodiksen ecd00ad
Add method for creating a table log in the WAL
CGodiksen a3d14b6
Add table logs when creating the write ahead log
CGodiksen 6c1582b
Add file path to log file struct
CGodiksen a4ed7c3
Add method to remove table log
CGodiksen 4bcb746
Add StreamWriter to WriteAheadLogFile
CGodiksen 16aa8a4
Add method to append and sync to WriteAheadLogFile
CGodiksen c7f3771
Add simple method to read all data from a log file
CGodiksen 0219a57
Lock the file when we append and sync
CGodiksen 1c68123
No longer allow WriteAheadLog to be created with non-local data folder
CGodiksen 4183734
Use path saved in field when reading log file
CGodiksen 484cc56
Use Mutex instead of locking the file itself
CGodiksen c4448ba
Acquire mutex during reading for safety
CGodiksen cc581ce
Handle unexpected EOF error directly instead of allowing all errors
CGodiksen 5b9ecbd
Create table log file when time series table is created
CGodiksen 99269e9
Delete the table log file when dropping time series tables
CGodiksen b2dd2b0
Pass write-ahead log to storage engine as well
CGodiksen 748662a
Append to write-ahead log in storage engine when inserting data points
CGodiksen cf77ef7
Use sync_data() instead of sync_all()
CGodiksen 41f3151
Prevent duplicate WAL schema header on open
CGodiksen 7dc9a47
Fix windows issue with append mode and set_len
CGodiksen 842e87e
Add unit tests for WriteAheadLogFile
CGodiksen 80965a4
Import module for test function imports
CGodiksen 2152dd2
Install serde_json for commit metadata
CGodiksen 5bfaf0c
Add batch ids to DeltaTableWriter
CGodiksen ed74f3b
Add WAL batch id to IngestedDataBuffer so it is passed to uncompresse…
CGodiksen 92e576f
No longer read spilled buffers back into memory on startup
CGodiksen 3a6f06e
Pass batch ids through uncompressed data manager
CGodiksen 3ab29e6
Pass batch ids through compressed data manager
CGodiksen 01f672b
Pass batch ids when writing compressed segments
CGodiksen 766cf53
Add batch id to WriteAheadLogFile
CGodiksen f3f114a
Use folder path instead of file path when initializing WriteAheadLogFile
CGodiksen eb74385
Handle existing wal files and ensure batch id is initialized correctly
CGodiksen 676288c
Add checks the next batch id in unit tests
CGodiksen bb9cbc5
Add batch offset to WriteAheadLogFile struct fields
CGodiksen 7d403c6
Add method to mark batches as persisted
CGodiksen 8332e4a
Add write ahead log to compressed data manager
CGodiksen e39d1bf
Add method to WriteAheadLog to mark batches as persisted in table log
CGodiksen 3c50c93
Remove duplicated code to find table log
CGodiksen 030fddb
Mark batches as persisted when right after they are saved
CGodiksen 1be33dd
Use AtomicU64 for next batch id instead of a Mutex
CGodiksen 7238e41
Add treshold for when to rotate segments
CGodiksen e3ab7bc
Remove the entire folder when removing table log
CGodiksen c2e109f
Add struct for completed write ahead log segments
CGodiksen ef0e761
Add struct for active segments
CGodiksen 7cb50d6
Update WriteAheadLogFile fields to use new closed and active segments
CGodiksen 72f30ec
Add util function for finding closed segments
CGodiksen 39a017f
Add util method to close leftover active segment
CGodiksen 2bb6a39
Add util method to read batches from path with tolerance for missing EOF
CGodiksen 2e21bf4
Add new try_new method that finds closed segments and uses new Active…
CGodiksen 222a747
Refactor append_and_sync so it rotates segments if the treshold is hit
CGodiksen affbb91
Add new method to rotate active segment
CGodiksen 5d91b70
Use ActiveSegment initialization function to remove duplicated code
CGodiksen cd39c88
Now deleting fully persisted segments when marking batches as persisted
CGodiksen 1f8d98d
Read both from closed and active segment in read_all
CGodiksen 8b329b3
Update tests to match new segment implementation
CGodiksen 623e78c
Add tests for closing leftover active segments
CGodiksen 9102239
Add more unit testing for mark_batches_as_persisted
CGodiksen 58099db
Add method to storage engine to insert data that already has a WAL ba…
CGodiksen 39681d5
Update read_all so it now returns both record batches and batch id
CGodiksen 4b72b48
Fix tests and a small underflow bug caused by reading empty file
CGodiksen d7de30f
Add method to find all unpersisted batches
CGodiksen f456aa5
Add separate method to load persisted batches from delta table
CGodiksen 4c578aa
Add separate method to get unpersisted batches
CGodiksen 9e323cb
Now initializing log files with persisted batches from commit history
CGodiksen cff29c6
No longer create temp dir in util method
CGodiksen 5623427
Add test for checking that commit history with no batch ids changes n…
CGodiksen 53ceffd
Add tests for checking that commit history updates persisted batch ids
CGodiksen 926c951
Add test for checking that fully persisted closed segments are deleted
CGodiksen ae9afa3
Add test for checking that partially persisted closed segments are re…
CGodiksen d451700
Add tests for unpersisted_batches()
CGodiksen 3a97ef0
Add test for ensuring that unpersisted_batches includes closed and ac…
CGodiksen f6d2420
Add method to get unpersisted batches in table log
CGodiksen 253b594
Add method to context to replay write ahead log
CGodiksen ecae75b
Calling replay write ahead log in main
CGodiksen c574c8b
Create time series table in compressed data manager tests
CGodiksen 08afca4
Fix doc issues
CGodiksen 25d12cc
Fix dependency issue after rebase
CGodiksen a722bb8
Add logging to WriteAheadLog struct
CGodiksen 709a036
Add logging for creating WAL file and appending
CGodiksen 6fdd510
Add logging for rotating segments, deleting closed segments, and load…
CGodiksen 8006bac
Add logging for reading WAL files and closing leftover active files
CGodiksen c1c93fe
Add warn message when replaying unpersisted batches
CGodiksen e092e65
Add debug message for marking batches as persisted
CGodiksen 417578a
Write-ahead log instead of write-ahead-log
CGodiksen a4fe666
Add unit tests for WriteAheadLog try_new
CGodiksen f14b88a
Add unit tests for creating table log
CGodiksen b6c0d7e
Add unit tests for removing table log
CGodiksen 1b0d688
Add unit tests for append to table log
CGodiksen 1ac6b35
Add unit tests for mark batches as persisted
CGodiksen ac7eff9
Add unit tests for unpersisted batches
CGodiksen 7feda8f
Add unit test for removing table log and appending again
CGodiksen 6c67bb4
Add unit test for loading persisted batch ids on try new
CGodiksen aaee538
Add more assertions to cover scenario with one closed segment and one…
CGodiksen c38839b
Only log closed segments if there are any
CGodiksen c4f240a
Minor type and documentation changes
CGodiksen d1d508d
Locking closed segments immediately when rotating active segment
CGodiksen 13a1e6f
Minor refactoring to WAL code
CGodiksen 91fbb66
Minor test refactoring to WAL code
CGodiksen b74bb0a
Fix small issue with order or retain and delete when marking as persi…
CGodiksen 55f97c7
Merge branch 'main' into dev/write-ahead-log
CGodiksen 73f9357
Expanded documentation for batch_ids field
CGodiksen 081a943
Append CompressedSegmentBatch to CompressedDataBuffer directly
CGodiksen 55c6b11
Add more WAL specific documentation and change WAL folder
CGodiksen 369affc
Remove all mentions of operations from WAL
CGodiksen e6602a7
Remove DeltaTable from create_table_log arguments
CGodiksen aa7b209
Rename WriteAheadLogFile to SegmentedLog
CGodiksen a65df7a
No longer use "rotation" terminology in WAL
CGodiksen 9825bd9
Update based on comments from @skejserjensen
CGodiksen d5da572
Merge branch 'main' into dev/write-ahead-log
CGodiksen 9addf20
Fix writing of record batches after merge
CGodiksen 023b277
Update based on comments from @chrthomsen
CGodiksen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.