Piotr Jastrzebski
222b94c707
cdc: Return preimage only when it's requested
...
Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com >
2019-11-25 12:43:39 +01:00
Piotr Jastrzebski
595c9f9d32
cdc::append_log_mutations: fix undefined behavior
...
The code was iterating over a collection that was modified
at the same time. Iterators were used for that and collection
modification can invalidate all iterators.
Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com >
2019-11-25 12:43:39 +01:00
Piotr Jastrzebski
f0f44f9c51
cdc::append_log_mutations: use do_with instead of shared_ptr
...
This will not only safe some allocations but also improve
code readability.
Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com >
2019-11-25 12:43:39 +01:00
Piotr Jastrzebski
b8d9158c21
cdc: Don't take storage_proxy as transformer::pre_image_select param
...
transformer has access to storage_proxy through its _ctx field.
Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com >
2019-11-25 12:43:39 +01:00
Calle Wilund
7d98f735ee
cdc: Add static columns to data/preimage mutations
...
Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com >
2019-10-28 06:16:12 +01:00
Calle Wilund
19bba5608a
cdc: Create and perform a pre-image select for mutations
...
As well as generate per-image rows in resulting log mutation
Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com >
2019-10-28 06:16:12 +01:00
Calle Wilund
d4ee1938c7
cdc: Add modification record for regular atomic values in mutations
...
Fills in the data columns for regular columns iff they are
atomic (not unfrozed collections)
2019-10-28 06:16:12 +01:00
Calle Wilund
3fdcbd9dff
cdc: Set row op in log
...
Adds actual operation (part delete, range delete, update) to
cdc log
2019-10-28 06:16:12 +01:00
Calle Wilund
8a6b72f47e
cdc: Add pre-image select generator method
...
Based on a mutation, creates a pre-image select operation.
Note, this uses raw proxy query to shortcut parsing etc,
instead of trying to cache by generated query. Hypothesis is that
this is essentially faster.
The routine assumes all rows in a mutation touch same static/regular
columns. If this is not always true it will need additional
calculations.
Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com >
2019-10-28 06:16:12 +01:00
Calle Wilund
451bb7447d
cdc: Add log / log data column operation types and make data cols tuples of these
...
Makes static/regular data columns tuple<op, value, ttl> as per spec.
Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com >
2019-10-28 06:16:12 +01:00
Piotr Jastrzebski
eb8ae06ced
cdc: Return db_context::builder by reference
...
from it's with_* functions.
Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com >
2019-10-22 17:13:43 +03:00
Piotr Jastrzebski
997be35ef3
modification_statement: log in cdc clustering key of a change
...
Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com >
2019-10-17 11:28:23 +02:00
Piotr Jastrzebski
96c800ed0b
modification_statement: log in cdc partition key of a change
...
Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com >
2019-10-17 11:28:23 +02:00
Piotr Jastrzebski
81a34168a3
create_table_statement: handle 'with cdc ='
...
Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com >
2019-10-17 11:28:14 +02:00
Piotr Jastrzebski
ca9536a771
schema: add _cdc_options field
...
Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com >
2019-10-17 10:55:31 +02:00