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

[WIP] Implement a commitlog. #15

Open
wants to merge 56 commits into
base: master
Choose a base branch
from
Open

[WIP] Implement a commitlog. #15

wants to merge 56 commits into from

Conversation

jkozlowski
Copy link
Owner

@jkozlowski jkozlowski commented Aug 28, 2019

TODO

  • Writing to segment buffer and returning a handle that indicates when that position of commit log is durable
  • Flushing to a position.
  • Closing a commit log safely.
  • Flush semaphore for concurrency control.
  • Commit log replay
  • End-to-end tests: start commit log, write concurrently for 1 minute, with flushes happening etc., then collect all writes, close cleanly, replay and check that state in-memory is the same.

Done

  • Flush queue
  • Gate
  • Cycling a buffer (writing part of segment to underlying file).
  • Maintaining an open pool of segments.

Functions

  • Commitlog#add

  • SegmentManager#allocate_when_possible

  • SegmentManager#active_segment

  • SegmentManager#current_segment

  • SegmentManager#new_segment

  • SegmentManager#finish_and_get_new

  • SegmentManager#flush_segments

  • SegmentManager#do_pending_deletes

  • SegmentManager#acquire_zeroed_buffer

  • Segment#replenish_reserve

  • Segment#cycle

  • Segment#do_flush

  • Segment#new_buffer

  • Segment#batch_cycle

  • Segment#flush

  • Segment#sync

  • Segment#reset_sync_time

This whole queue thing feels a bit weird,
given the position is maintained by the OS...
Might need to clone + seek, since we want to maintain this ourselves,
since we'll want to eventually use spdk/io_uring.
Keeping the interface so that it is compatible with uring,
so not taking buffers by reference, instead owning it.
Also pushing pos to each write, which means with current impl
I need to open the file everytime.
Need to now open the file every time and I should be able to get what I want.
It doesn't actually control concurrency, but code can use it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant