Commit Graph

35 Commits (8e5d5928cf700201fe9b0f17b506ebc6dc1b47ac)

Author SHA1 Message Date
Edd Robinson 2d6a23f7c3 fix: avoid potential race 2021-07-19 14:02:29 +01:00
Edd Robinson dfda23f24a test: update e2e tests 2021-07-19 14:00:10 +01:00
Edd Robinson dd93b2cdec feat: add db-level compaction limiter 2021-07-19 14:00:10 +01:00
Marco Neumann 71b5030fc0 refactor: remove unused `LockableChunk::write_to_object_store` 2021-07-16 11:45:34 +02:00
Raphael Taylor-Davies a79c0b4e75
feat: add mub row count threshold to lifecycle rules (#1876) (#2016)
* feat: add mub row count threshold to lifecycle rules (#1876)

* chore: update docstring

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-07-15 13:42:17 +00:00
Marco Neumann 77a9191a11 fix: chunk dropping over lifecycle policy should also respect the preserved catalog 2021-07-15 12:07:56 +02:00
Raphael Taylor-Davies f1c1620c84
feat: make persistence windows interface harder to use incorrectly (#1977)
* feat: make persistence windows interface harder to use incorrectly

* chore: review feedback

* chore: update comment

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-07-14 13:03:18 +00:00
Raphael Taylor-Davies 5a0caeab44
feat: skip over fully persisted partitions (#1962) (#1973)
* feat: skip over fully persisted partitions (#1962)

* chore: review feedback
2021-07-13 10:40:45 +00:00
Andrew Lamb d35b74c226
fix: Fix doc build warnings (#1945)
* fix: Fix doc build warnings

* refactor: add deny bare_urls to crates

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-07-13 08:03:42 +00:00
Raphael Taylor-Davies a54cd04b30
feat: log reason for triggering persistence (#1957) (#1967)
* feat: log reason for triggering persistence (#1957)

Don't panic on no eligible chunks to persist (#1966)

* fix: fix conditions and logging

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-07-12 18:28:00 +00:00
Paul Dix 0c8c81a321 refactor: remove mutable_linger_seconds from lifecycle
The interplay between mutable_linger_seconds, late_arrive_window and persist_age_threshold_seconds can be tricky to reason about. I realized that the lifecycle rules can be simplified by removing mutable_linger_seconds and instead using late_arrive_window_seconds for the same purpose. Semantically, they basically mean the same thing. We want to give data around this amount of time to arrive before the system persists it, which gives it more of an opportunity to persist non-overlapping data.

When a partition goes cold for writes, after we've waiting past this window, we should compact and persist that partition. This removes one unnecessary knob from the lifecycle configuration and also removes the potential for conflicting configuration options.
2021-07-10 08:04:33 -04:00
Raphael Taylor-Davies 7af560aa99
feat: Persist lifecycle action (#1888)
* feat: add split and persist operation

* docs: Improve doc strings

* refactor: use for loop rather than map

* refactor: Make it clear that the lifecycle policy picks the split timestamp

* fix: race condition

* docs: improve comments

* fix: logical merge conflict

* fix: clippy

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
2021-07-09 13:21:46 +00:00
Paul Dix e41fd2a821 refactor: remove unused mutable_minimum_age_seconds lifecycle setting
Closes #1878
2021-07-08 18:34:01 -04:00
Andrew Lamb 72928aab3d
refactor: Move ChunkLifecycleAction to the data_types crate (#1939) 2021-07-08 20:18:33 +00:00
Marko Mikulicic 7059f16b9e
refactor: Turn mutable_linger_seconds into a non-optional (#1917) 2021-07-08 11:25:57 +02:00
Marko Mikulicic 0ec11eb907
fix: Handle None mutable_linger_seconds in can_move
This will be followed by a cleanup PR that will no longer make mutable_linger_seconds an option
and move the defaulting to the configuration layer.

Closes #1899
2021-07-08 11:02:09 +02:00
Marko Mikulicic c63e2fe605
chore: Add debug logs to maybe_compact_chunks (#1911)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-07-07 12:06:26 +00:00
Marko Mikulicic 17b82ebcd6
chore: Add some more tests for can_move 2021-07-07 13:03:38 +02:00
Marko Mikulicic 41f49db3c1
fix: Increase log level for important lifecycle events
This can possibly help us better understand #1899.

The practical reason for increasing the log level for those
events is that we cannot currently ingest debug logs in our log aggregation system,
but it currently takes 7h to reproduce #1899 which means we don't have access to debug logs
from `kubectl logs` to help us troubleshoot.

That said, I do think that these logs are not debug logs but legit lifecycle information.
In particular if a log says "unexpected ..." I think it may be better regarded as an error/warning.
(If it becomes too verbose, it means its either a bug or not that unexpected).
2021-07-07 10:57:56 +02:00
Marco Neumann 4f5fe62428
feat: add DB name to lifecycle logs (#1900)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-07-06 16:14:28 +00:00
Marco Neumann f45679183c chore: use saturating sub instead of simple sub 2021-07-06 16:41:36 +02:00
Marco Neumann 677314f52f fix: `persist_row_threshold` limits the out chunk row count
`persist_row_threshold` should limit the rows of the post-compaction
output chunk (and hence the sum of rows over the input chunks), not
the number of rows of each individual input chunk.

Fixes #1874.
2021-07-06 15:17:56 +02:00
kodiakhq[bot] 404da38d6f
Merge branch 'main' into pd-remove-mb-size-limit-checks 2021-07-01 20:01:32 +00:00
Raphael Taylor-Davies 5b00bc69e6
refactor: use Arc<Db> in lifecycle actions (#1873)
* refactor: use Arc<Db> in lifecycle actions

* chore: review feedback
2021-07-01 19:56:33 +00:00
Paul Dix 61917c107f chore: add test for can_move on row count 2021-07-01 15:49:44 -04:00
Paul Dix 91f5478012 feat: remove MUB size threshold
Removes the MUB chunk close based on size. Also add a check in lifecycle policy to move if the MUB chunk crosses a default row count threshold.
2021-07-01 14:58:29 -04:00
Raphael Taylor-Davies f1a100c6ae
refactor: remove now unused chunk sort order (#1854)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-07-01 16:39:45 +00:00
Raphael Taylor-Davies 43cabac3ac
feat: don't compact more than row threshold (#1868)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-07-01 16:31:50 +00:00
Raphael Taylor-Davies 99a15cd452
refactor: single lifecycle error enumeration (#1859)
* refactor: single lifecycle error enumeration

* fix: fmt

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
2021-06-30 18:35:57 +00:00
Raphael Taylor-Davies 635e4d0a7d
refactor: plumbing to prevent compaction starving persistence (#1852)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-06-30 13:43:25 +00:00
Raphael Taylor-Davies 297fc12db8
feat: compact chunks (#1776)
* feat: compact chunks

* chore: review feedback

* chore: clippy lints

* chore: document sort key algorithm

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-06-24 16:49:10 +00:00
Raphael Taylor-Davies 01b0fdabb7
feat: make lifecycle partition-aware (#1767)
* feat: make lifecycle partition-aware

* chore: further docs

* chore: rename to maybe_free_memory

* chore: fix logical conflicts

* chore: ensure only drops unpersisted chunks

* chore: clippy lints

* chore: fix doc

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-06-22 09:24:15 +00:00
Marco Neumann 7f188c3c94 chore: lint `lifecycle` crate 2021-06-22 11:05:55 +02:00
Raphael Taylor-Davies ea04ce40dc
feat: transactional lifecycle API (#1753)
* feat: transactional lifecycle API

* chore: remove redundant upgrade

* feat: lifecycle error propagation

* chore: add usage doctest

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-06-21 13:09:53 +00:00
Raphael Taylor-Davies bf54ab51f2
refactor: split lifecycle into separate crate (#1730) 2021-06-15 15:57:47 +00:00