Commit Graph

297 Commits (6644048eec11a5c818dd73a566293d8f3396de6e)

Author SHA1 Message Date
Marco Neumann 6644048eec refactor: remove partitioning from router config
Routers are not live yet so this ain't a breaking change. Also w/ write
buffer format rework that is going to be finished soon we don't need
this.
2021-11-02 10:14:00 +01:00
Marco Neumann 4c9570b519 refactor: move `catalog` protobuf to `preserved_catalog`
This makes it clearer what's going since the contained messages are
only for the preserved part, not the in-mem catalog and its management.
2021-11-01 18:07:25 +01:00
Marco Neumann 011af2d6ba feat: add `DeploymentService`
Ref #2980.
2021-11-01 17:55:40 +01:00
kodiakhq[bot] 8c3446ac87
Merge branch 'main' into crepererum/issue2980b 2021-11-01 16:39:32 +00:00
Marco Neumann c6c07879ee docs: explain deprecation 2021-11-01 11:38:46 +01:00
Marco Neumann bcd66c555a feat: add `RemoteService`
Ref #2980.
2021-11-01 11:38:46 +01:00
Marco Neumann 83e4514a43 feat: add `DeleteService`
Ref #2980.
2021-10-29 11:57:31 +02:00
Carol (Nichols || Goulding) e4e494f1d9
fix: Remove now-unused transition function. Fixes #2762. 2021-10-28 13:30:43 -04:00
Carol (Nichols || Goulding) 0bccd35f8c
fix: List details about databases only prints active dbs and their UUIDs
We can no longer list deleted databases because the server no longer
knows about them, and we now have UUIDs that are useful to know about,
so change the detailed listing of databases to return UUID instead of
possible deleted at time.
2021-10-28 13:20:29 -04:00
Carol (Nichols || Goulding) ce55cf401c
feat: Return UUID when creating a database
Seems polite and is useful for some test setup
2021-10-28 13:20:29 -04:00
Carol (Nichols || Goulding) 4077d3a20a
fix: Take a UUID when restoring a database 2021-10-28 13:20:29 -04:00
Carol (Nichols || Goulding) 95ba84edca
fix: Return UUID when a database is deleted
So that it can be immediately used to restore elsewhere.
2021-10-28 13:20:29 -04:00
Carol (Nichols || Goulding) f160712f5e
fix: Remove the concept of generations
From iox_object_store and everywhere that fails to compile as a result.

Also make path handling in iox_object_store a bit more consistent.
2021-10-28 13:20:28 -04:00
kodiakhq[bot] c23037fb33
Merge branch 'main' into crepererum/router_draft 2021-10-25 15:23:00 +00:00
Marco Neumann bc7244c48e chore: use Rust edition 2021 2021-10-25 10:58:20 +02:00
Carol (Nichols || Goulding) 948cf92aaa fix: Remove the ability to list deleted databases
Once we're relying on the server config file to know about databases,
IOx shouldn't be listing files in object storage to try and find deleted
databases.

When the disown API is implemented for the floating database design, it
will return the UUID of the database just disowned, so that it can
immediately be used in an adopt API call.
2021-10-22 14:50:06 -04:00
Marco Neumann 7db09316f1 refactor: move router into its own service 2021-10-21 10:35:09 +02:00
Marco Neumann c27f096377 feat: rework router config 2021-10-21 10:09:29 +02:00
Marco Neumann 4f78981958 refactor: factor out partition cfg into its own proto file 2021-10-21 10:09:29 +02:00
Marco Neumann 1fc00095f5 refactor: factor out write buffer cfg into its own proto file 2021-10-21 10:09:29 +02:00
Marco Neumann f75bd0771a refactor: sort file list in build script 2021-10-21 10:09:29 +02:00
kodiakhq[bot] f4eb3884f3
Merge branch 'main' into cn/write-db-owner-file 2021-10-20 13:51:45 +00:00
Marco Neumann 2079fb689e chore: remove unused `generated_types` => `thiserror` dep 2021-10-19 14:45:56 +02:00
Carol (Nichols || Goulding) 10912c2b97 feat: Write owner info in the database's object store directory
Use this as an extra check that the database thinks the current server
is its owner when a server tries to initialize and own a database.

If the owner info doesn't match the current server, which could happen
if a server's config was updated but the database's owner info wasn't,
put the database in an error state that requires operator intervention.
2021-10-18 21:13:20 -04:00
Carol (Nichols || Goulding) d5ab29711e fix: Serialize relative db object store paths to the server config
So that they can be deserialized, without parsing, to create a new
iox object store from the location listed in the server config.

Notably, the locations serialized don't start with the object storage's
prefix like "s3:" or "file:". The location is the same object storage as
the server configuration that was just read from object storage. Having
the server config on one type of object storage and the database files
on another type is not supported.
2021-10-18 08:37:36 -04:00
Carol (Nichols || Goulding) 26484309e0 fix: Re-export prost errors instead of wrapping them 2021-10-15 13:44:53 -04:00
Carol (Nichols || Goulding) def65cfea0 docs: Add examples of the expected database locations 2021-10-15 11:10:10 -04:00
Carol (Nichols || Goulding) 2253a7ba62 fix: Use a map in the server config protobuf 2021-10-15 10:52:59 -04:00
Carol (Nichols || Goulding) afd6e826e5 feat: Write out server config files listing database name and locations 2021-10-15 09:46:20 -04:00
Carol (Nichols || Goulding) 5348c9e503 refactor: Move ProstError to root of generated_types to be useful elsewhere 2021-10-15 09:46:20 -04:00
Raphael Taylor-Davies 074ae40382
feat: migrate entry to use bytes::Bytes (#2842)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-10-14 10:55:51 +00:00
Raphael Taylor-Davies 8a82f92c5d
refactor: add TimeProvider abstraction (#2722) (#2815)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-10-12 21:19:03 +00:00
Raphael Taylor-Davies 3dfe400e6b
feat: migrate write path to TimeProvider (#2722) (#2807) 2021-10-12 12:09:08 +00:00
Marco Neumann c4a2641764 refactor: remove `time_closed`
The "time closed" is a leftover from an old lifecycle system, where
chunks moved through the system (open=>closed=>persisted) without being
merged. Now we have the compaction as well as the split query for
persistence that can merge chunks, so a single "time closed" doesn't
make sense any longer. So in fact it is `None` for many chunks and is
also not persisted. Also the current lifecycle policy doesn't use this
value. So let's just remove it.

Closes #1846.
2021-10-11 15:49:34 +02:00
dependabot[bot] 1327735537
chore(deps): bump thiserror from 1.0.29 to 1.0.30
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.29 to 1.0.30.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.29...1.0.30)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-11 08:01:21 +00:00
Marco Neumann d3de6bb6e4 refactor: `max_persisted_timestamp` => `flush_timestamp`
There might be data left before this timestamp that wasn't persisted
(e.g. incoming data while the persistence was running).
2021-10-08 12:36:23 +02:00
Marco Neumann 63a932fa37 refactor: "min unpersisted ts" => "max persisted ts"
Store the "maximum persisted timestamp" instead of the "minimum
unpersisted timestamp". This avoids the need to calculate the next
timestamp from the current one (which was done via "max TS + 1ns").

The old calculation was prone to overflow panics. Since the
timestamps in this calculation originate from user-provided data (and
not the wall clock), this was an easy DoS vector that could be triggered
via the following line protocol:

```text
table_1 foo=1 <i64::MAX>
```

which is

```text
table_1 foo=1 9223372036854775807
```

Bonus points: the timestamp persisted in the partition
checkpoints is now the very same that was used by the split query during
persistence. Consistence FTW!

Fixes #2225.
2021-10-08 11:52:49 +02:00
Carol (Nichols || Goulding) 15b396c720 fix: Set a UUID if none was read from object storage on server startup
This enables a smoother transition to this state when this gets
deployed.
2021-10-07 10:19:17 -04:00
Carol (Nichols || Goulding) 169f2499d3 fix: Use bytes for UUID in the protobuf instead of string 2021-10-07 10:19:17 -04:00
Carol (Nichols || Goulding) ae7d893199 feat: Add UUID to databases
Connects to #2675.

When a database is created, assign it a UUID and serialize the UUID to
object storage by wrapping the database rules in a new
`PersistedDatabaseRules` type that also contains the UUID.

All APIs to the end user involving rules should continue using only
`DatabaseRules` so the UUID is an internal implementation detail.
2021-10-07 10:19:14 -04:00
Carol (Nichols || Goulding) 27e7a1f925 refactor: Organize use statements 2021-10-07 10:17:19 -04:00
Marco Neumann 63d74be490 refactor: make `ChunkId` a UUID 2021-10-07 10:23:27 +02:00
Nga Tran eebbb9a165 chore: clea up dead code 2021-10-05 13:08:40 -04:00
Raphael Taylor-Davies 2a584420b3
refactor: make data_types optional dependency (#2739)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-10-05 15:07:45 +00:00
Nga Tran 825ddaa34c chore: merge main to branch 2021-10-05 10:12:17 -04:00
Marco Neumann b8aa4c33ce refactor: use protobuf bytes for transaction UUIDs 2021-10-05 12:27:48 +02:00
Marco Neumann 10c1a72402 refactor: remove unused fields from `DeletePredicate` 2021-10-05 09:29:24 +02:00
Nga Tran ff8e037971 feat: handle delete response 2021-10-04 20:37:53 -04:00
Marco Neumann 97881079e8 refactor: make `ChunkOrder` non-zero
This will make it easier to handle missing values.

Helps with #2633.
2021-10-04 17:49:12 +02:00
Marco Neumann a0bbbdb197 refactor: use dedicated in-memory `Expr` type during IO
Place a dedicated `Expr` type between datafusion and protobuf. While
this type is currently only used during serialization, it will be used
within `Predicate` in a follow-up change to enable de-duplication of
predicates and avoid the double parsing of datafusion expressions (we
are already somewhat parsing them when we check for valid delete
predicates).

This change looks larger than it is. In practice it just separates the
conversion "datafusion => protobuf" into "datafusion => IOx => protobuf"
and "protobuf => datafusion" into "protobuf => IOx => datafusion". So
(apart from the error types) this is functionally the same.
2021-10-04 09:59:14 +02:00