Commit Graph

503 Commits (c77c4b3d238b858c31733c717cf58632a71739bc)

Author SHA1 Message Date
Carol (Nichols || Goulding) 92e5036943
fix: Size of ColumnSet shouldn't be using ChunkId (#7786) 2023-05-12 14:58:03 +00:00
Dom Dwyer 01205e9671
refactor: assert Column.table_id matches
Include an invariant assert when adding a Column to a TableSchema,
ensuring the table IDs match.
2023-05-09 14:55:04 +02:00
Dom Dwyer 18c6d9e306
refactor: remove unnecessary "to_owned()" call
This method now takes an owned name, so no need to call to_owned()!
2023-05-09 14:55:03 +02:00
Dom Dwyer ab666ea5fa
refactor: owned ColumnsByName constructor only
Refactors the From<BtreeMap> impl that accepted a &str name for
ColumnsByName construction, instead allowing only the owned String, and
updating the test that makes use of it appropriately.
2023-05-09 14:55:03 +02:00
Carol (Nichols || Goulding) 23c0110b32
feat: Create newtypes for different partition templates
So that the different kinds aren't mixed up. Also extracts the logic
having to do with which template takes precedence onto the
PartitionTemplate type itself.
2023-05-09 14:55:02 +02:00
Carol (Nichols || Goulding) 28d4f4743c
refactor: Move PartitionTemplate and friends to their own module 2023-05-09 14:55:01 +02:00
Carol (Nichols || Goulding) e8a480f5f6
fix: Give up ownership of Column when adding to a table
To enable reuse of existing allocations rather than borrowing, creating
new allocations, then dropping them.
2023-05-09 14:55:00 +02:00
Carol (Nichols || Goulding) e8655af52d
fix: Change ColumnsByName::new to enable taking ownership if caller wants to give it 2023-05-09 14:55:00 +02:00
Carol (Nichols || Goulding) 1f42fd8ebf
fix: Move column types to their own module and encapsulate more details 2023-05-09 14:55:00 +02:00
Carol (Nichols || Goulding) bbf6a5087c
fix: Return an iterator rather than allocating a Vec 2023-05-09 14:54:59 +02:00
Carol (Nichols || Goulding) cc41216382
fix: Undo the addition of a TableInfo type; store partition_template on TableSchema 2023-05-09 14:54:59 +02:00
Carol (Nichols || Goulding) 596673d515
refactor: Create a new ColumnsByName type to abstract over TableSchema columns
And allow usage of just the columns when that's all that's needed
without leaking the BTreeMap implementation detail everywhere
2023-05-09 14:54:58 +02:00
Carol (Nichols || Goulding) b5af971190
fix: Make NamespaceSchema::new_empty_from rather than From::from
To avoid implying that this constructor caches the tables.
2023-05-09 14:54:58 +02:00
Carol (Nichols || Goulding) 1f1dcc947d
fix: Don't change how the compactor gets the table schema 2023-05-09 14:54:58 +02:00
Carol (Nichols || Goulding) 58d9c40ffd
feat: If namespace or table partition templates are specified, use those 2023-05-09 14:54:57 +02:00
Carol (Nichols || Goulding) c1a8408572
fix: Consolidate the default partition template; remove --partition-key-pattern CLI option 2023-05-09 14:54:57 +02:00
Carol (Nichols || Goulding) 2aa8713d1d
fix: Remove partition TemplatePart::Table; partitioning is already per-table 2023-05-09 14:54:57 +02:00
Carol (Nichols || Goulding) 3d5df5574a
fix: Remove vestiges of shards 2023-05-08 20:24:36 -04:00
Carol (Nichols || Goulding) ef9ef75e56
fix: Remove unsupported TemplatePart variants (#7746)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-05-04 16:20:18 +00:00
Carol (Nichols || Goulding) b0959667d5
fix: Move topic and query pool within iox catalog (#7734)
Still insert them into the database and associate them with namespaces,
but don't ever query them back out.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-05-04 13:45:56 +00:00
Carol (Nichols || Goulding) 621caab2e9
fix: Remove unused parquet_max_sequence_number metadata 2023-05-03 10:57:27 -04:00
Carol (Nichols || Goulding) 038f8e9ce0
fix: Move shard concepts into only the catalog
This still inserts the shard id into the database, always set to the
TRANSITION_SHARD_ID, but never reads it back out again.
2023-04-26 11:42:32 -04:00
wiedld 3990dcd519
Merge branch 'main' into idpe-17434/namespace-validation-alignment 2023-04-25 09:41:45 -07:00
wiedld b3cdea25ba chore: update term conventions to allowlist 2023-04-24 17:07:25 -07:00
Carol (Nichols || Goulding) 7b7101b53f
fix: In DmlMeta, only use SequenceNumber rather than Sequence (shard index plus seq num) 2023-04-24 12:23:16 -04:00
wiedld daabe9663c chore(idpe-17434): make restrictive whitelist of chars accepted, for any NamespaceName 2023-04-21 16:36:00 -07:00
wiedld b870242ec7 chore(idpe-17434): remove utf8-percent encoding on v2 write path, such that it matches v1 writes and onCreate 2023-04-21 16:31:55 -07:00
Carol (Nichols || Goulding) 0ac2494c5d
fix: Remove unused partitions_with_recent_created_files method
And PartitionParam type.
2023-04-20 14:54:03 -04:00
Dom Dwyer 92b1055e41
refactor: error message should not end in .
Change the "bad character" namespace name error to not include a
trailing "."
2023-04-18 14:46:22 +02:00
Carol (Nichols || Goulding) f1850c9234
fix: Remove unused level_1 function and TablePartition type 2023-04-17 19:28:50 -04:00
Carol (Nichols || Goulding) 6c06b9fd7a
fix: Remove unused list_type_count_by_table_id and ColumnTypeCount 2023-04-17 19:28:49 -04:00
Carol (Nichols || Goulding) 5e6dbec909
fix: Remove tombstones as they aren't functional currently 2023-04-14 13:36:08 -04:00
Carol (Nichols || Goulding) acf857816e
fix: Remove old querier 2023-04-12 13:18:23 -04:00
Carol (Nichols || Goulding) 6387a9576a
fix: Remove the write_summary crate and write info service 2023-04-12 11:31:23 -04:00
Dom Dwyer 7fed2ba456 feat(router): single tenancy operational mode
Adds a single-tenant mode (CST) to the IOx routers.

Single-tenancy mode differs in two main ways:

    * V1 write endpoint is partially supported
    * V2 write endpoint ignores "org" parameter

The "normal" mode is "multi tenant" which is the default operational
mode, and all existing behaviour remains unchanged. Single tenant mode
can be enabled by specifying INFLUXDB_IOX_SINGLE_TENANCY=true.

Request parsing is delegated to two implementations of the
WriteParamExtractor trait, one each for CST and MT - the logic of each
"mode" is defined within these files and all other functionality is
common between the two.

This commit also renames some of the error types for clarity
(NoSpecified -> NoOrgBucketSpecified, other NotSpecified ->
NoQueryParams, etc).

Note: single tenant code requires testing
2023-04-10 12:59:20 -07:00
Dom Dwyer d322791d12
refactor: tidy NamespaceName construction errors
There was a mix of different ways of returning errors - this commit
unifies them, adds some documentation to the returned errors, and
removes the capitalisation.

Errors should be lower-case so they compose nicely like this:
    "something failed: super important error: inner error"
rather than:
    "something failed: Super important error: Inner error"
2023-03-31 16:27:26 +02:00
Dom Dwyer 65034cfaa6
refactor: org & bucket parser on NamespaceName
Moves the function org_and_bucket_to_namespace() to be an associated
method (constructor) on the NamespaceName itself.
2023-03-31 16:12:49 +02:00
Dom Dwyer 259dc04937
refactor: move NamespaceName & related fn into mod
Moves the NamespaceName, associated errors and helper functions into
it's own module.
2023-03-31 15:58:09 +02:00
Dom Dwyer 0a2cb33f7d
test: property test SequenceNumberSet operations
Adds proptests to assert correctness of set operations against a
SequenceNumberSet, by ensuring they match those of a known-good
implementation from the stdlib (HashSet).

Ensure (de-)serialisation correctness by asserting a round trip results
in equal sets.
2023-03-20 14:23:43 +01:00
Dom Dwyer 5680710e75
fix: full u64 range in SequenceNumberSet
Prior to this commit, the SequenceNumberSet accepted values up to
u32::MAX (approx 4.2 billion) which works out to be ~50 days of
continious ID allocation at 1k writes/s.

This commit changes the SequenceNumberSet to accept the full range of a
u64, with the caveat that outside of the u32 range, values may be
ordered incorrectly. See:

    https://github.com/influxdata/influxdb_iox/issues/7260

Fortunately values from SequenceNumberSet are used as an identity, and
never for ordering. We should remove the PartialOrd bounds on
SequenceNumber once Kafka has been cleaned up to encode this in the type
system.
2023-03-20 14:15:30 +01:00
Andrew Lamb 28cb56767c
fix: Rename crate `influxdb_line_protocol` to `influxdb-line-protocol` (#7244)
* fix: Rename crate `influxdb_line_protocol` to `influxdb-line-protocol`

* fix: hakari config

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-17 13:19:50 +00:00
Marco Neumann 20ec47b00b
feat: virtual chunk order col (#7240)
* feat: introduce `CHUNK_ORDER_COLUMN_NAME`

* feat: impl `ChunkOrder` everywhere

* feat: `ChunkOrder::get`

* feat: emit chunk order column for `RecordBatchesExec`

* feat: `chunk_order_field`

* feat: chunk order col for parquet chunks

* feat: optional chunk order col handling for dedup

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-17 09:39:21 +00:00
Nga Tran 9e9e689a30
feat: handle large-size overlapped files (#7079)
* feat: split start-level files that overlap wiht many files

* test: split files and theit split times

* test: split test for L1 and L2 files

* feat: full implementation that support large-size overlapped files

* chore: modify comments to reflect the changes

* fix: typo

* chore: update test output

* docs: clearer comments

* chore: remove empty test files. Will add in in a separate PR

* chore: Apply suggestions from code review

Co-authored-by: Andrew Lamb <alamb@influxdata.com>

* chore: address review comments

* chore: Apply suggestions from code review

Co-authored-by: Andrew Lamb <alamb@influxdata.com>

* refactor: add a knob to turn large-size overlaps on and off

* fix: typo

* chore: update test output after merging main

* fix: split_times should not include the max_time of the file

* fix: fix an overlap bug while limitting number of files to compact

* test: unit tests for different overlap cases of limit files to compact

* chore: increase time range of the tests to let the split files work correctly

* fix: skip compacting files of tiny ranges

* test: add tests for time range 1

* chore: address review comments

* chore: remove  enable_large_size_overlap_files knob

* fix: fix a bug that sort L1 files in thier min_time instead of l0_max_created_at

* refactor: use the same order_files function afer merging main into branch

* chore: typos and clearer comments

* chore: remove obsolete comments

* chore: add asserts per review suggestion

---------

Co-authored-by: Andrew Lamb <alamb@influxdata.com>
2023-03-07 18:51:59 +00:00
Dom Dwyer ac1b37c0f0
feat(data_types): SequenceNumberSet intersection
Support computing the intersection of two SequenceNumberSet.
2023-03-03 17:21:39 +01:00
Dom Dwyer 146494f619
perf: pre-allocation of SequenceNumberSet
Support pre-allocation of SequenceNumberSet for known-length sets.
2023-03-03 17:21:38 +01:00
Dom Dwyer 7801a63334
feat: apply RLE optimisation for SequenceNumberSet
Allow a SequenceNumberSet to be space-optimised by transforming it to
use run length encoding.
2023-03-03 17:21:38 +01:00
Dom Dwyer 043f3421ba
feat(data_types): PartialEq for SequenceNumberSet
Derive + test partial equality matching for SequenceNumberSet.
2023-03-03 17:21:38 +01:00
Dom Dwyer 6aa33ef380
feat: impl FromIterator for SequenceNumberSet
Allow a SequenceNumberSet to be instantiated from an iterator of
SequenceNumber.
2023-03-02 10:58:02 +01:00
Dom Dwyer 6532fb752b
feat: impl Extend for SequenceNumberSet
Allow a SequenceNumberSet to be efficiently extended from any iterator
of SequenceNumber instances.
2023-03-02 10:58:01 +01:00
Carol (Nichols || Goulding) faae5eb438 chore: Rerun cargo hakari manage-deps 2023-02-27 11:56:15 +01:00