Commit Graph

26 Commits (8e5d5928cf700201fe9b0f17b506ebc6dc1b47ac)

Author SHA1 Message Date
kodiakhq[bot] 256aaa21e5
Merge branch 'main' into fbroot 2021-07-16 11:48:58 +00:00
Marco Neumann b5428e53a5 refactor: write buffer testing + better mocking
This refactors the write buffer a bit for:

- **Testing:** Add generic tests for the Kafka and the mocking
  implementation. The same interface can be used easily add new
  implementations (e.g. via Redis, filesystem, ...).
- **Partition on Write:** The caller of the writer operation must now
  specify the partition/sequencer ID. The implicit partitioning of the
  Kafka writer would have lead to broken data since we must never spill
  entries w/ the same primary key over multiple partitions. At the
  moment we will only use partition 0 but we can easily implement
  better logic in the future.
- **Improved Mocking:** The mocked implementation now simulates a system
  that feels more real. Especially the handling around multiple streams
  and "write while read" has been improved. This will be helpful for
  testing and for new features like seeking (during replay). A solid
  realistic mock also helps us to ensure that the tests using the mock
  do not rely on unrealistic behavior too much.
2021-07-15 17:20:45 +02:00
Marco Neumann c176a4ee09 fix: fix `Entry::clone` 2021-07-14 16:26:59 +02:00
Jacob Marble b79d9eb0ab
chore: add end-to-end test for PB write service (#1894)
* chore: add end-to-end test for PB write service

* chore: lint

* chore: fix test
2021-07-14 14:20:37 +00:00
Marco Neumann 157a0cc98c chore: update flatbuffers to 2.0 2021-07-13 15:44:45 +02:00
Marko Mikulicic 698b3773df
feat: Flatbuffers root_type and file_identifier 2021-07-09 16:39:40 +02:00
Andrew Lamb 33bc85ad18
feat: Infrastructure for persistence (#1925)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-07-08 11:14:38 +00:00
Marco Neumann 5ca9760c94 test: make partioning in DB tests consistent w/ DB rules 2021-07-08 09:18:09 +02:00
Marco Neumann 315217362f feat: add TableBatch -> Schema conversion 2021-07-08 09:18:09 +02:00
Carol (Nichols || Goulding) 479b15c2a3 fix: Outdated reference to a moved file in docs 2021-07-07 13:55:35 -04:00
Andrew Lamb d4f4af9068
fix: fix flatbuffers regeneration code (#1898)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-07-07 14:42:47 +00:00
Jacob Marble 0779b0d9bd
feat: add gRPC listener for new write protocol (#1842)
* feat: add gRPC listener for new write protocol

* chore: clippy happy

* chore: lint

* chore: cargo fmt --all

* chore: cargo clippy

* chore: protobuf-lint

* chore: more formatting

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-07-01 16:15:12 +00:00
Andrew Lamb 3ee96c4618
fix: Do not sequence local writes (avoid panic under load) (#1826)
* fix: Do not sequence local writes

* fix: Update server/src/db.rs

Co-authored-by: Edd Robinson <me@edd.io>

* fix: review comments

* fix: restore passing sequence information down to mutable buffer

* fix: store min/max times even when there are no sequence numbers

Co-authored-by: Edd Robinson <me@edd.io>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-06-29 10:39:37 +00:00
Paul Dix af93bb6573 chore: PR cleanup 2021-06-25 15:45:00 -04:00
Paul Dix 435b4b6a94 feat: add persistence windows to partition and update on write
This brings the persistence windows into the catalog partition. It adds a helper method on TableBatch to get the min and max times for a given write. Finally, it adds this logic to the db to update persistence windows on every write while the partition write lock is being held.
2021-06-25 15:34:11 -04:00
Carol (Nichols || Goulding) 50a69a7f18 fix: Don't mention Kafka unless it's absolutely necessary 2021-06-07 13:01:04 -04:00
Carol (Nichols || Goulding) a8a4a5f29d fix: Return the Sequence type from the write buffer, not vague WriteMetadata 2021-06-07 11:15:46 -04:00
Carol (Nichols || Goulding) f4a6c0b4bb refactor: Actually, why not just store entry as-is within SequencedEntry 2021-06-07 09:56:23 -04:00
Carol (Nichols || Goulding) 45a3547978 refactor: Take ownership of Entry and transform into SequencedEntry
Rather than cloning the data. The Entry is no longer used after this
point.
2021-06-07 09:56:23 -04:00
Carol (Nichols || Goulding) 8ab8544d4a feat: Wire up a WriteBuffer trait implemented by a mock
With an unimplemented where the Kafka implementation will be.
2021-06-07 09:56:23 -04:00
Carol (Nichols || Goulding) 0139167c98 refactor: Extract a Sequence type
A sequencer id and sequence number should always go together, so convey
that with a type. Also, this removes lots of repetition of "sequence" 😅
2021-06-07 09:37:22 -04:00
Carol (Nichols || Goulding) 4d6569583e fix: Partially restore SequencedEntry as Entry+sequencer_id+sequence_num 2021-06-04 14:40:19 -04:00
Carol (Nichols || Goulding) f4a9a5ae56 fix: Remove write buffer 2021-06-04 14:40:17 -04:00
Carol (Nichols || Goulding) 5c5064bdac
fix: Set default line timestamp and default partition time to same value (#1512)
* refactor: Rearrange to allow injection of the current time in tests

* test: Failing test showing a point can be in the wrong partition

* fix: Only get the default time once per ShardedEntry creation, in router
2021-05-24 14:55:11 +00:00
Andrew Lamb 9d0c3a2b1a
refactor: Remove multi-table per chunk code in MUB (#1471)
* refactor: Remove multi-table per chunk code in MUB

* fix: clippy

* fix: bench build

* fix: merge conflicts
2021-05-11 17:49:07 +00:00
Raphael Taylor-Davies 10f89a3e8d
refactor: split entry out into separate crate (#1428)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-05-06 11:36:23 +00:00