Commit Graph

4 Commits

Author SHA1 Message Date
Nadav Har'El
bb63db34e5 cql3: add extended wire format for per-element timestamps and TTLs
Introduce the infrastructure needed to transport per-element timestamps
and TTL expiry times from replicas to coordinators, required for
WRITETIME(col[key]) / TTL(col[key]) and WRITETIME(col.field) /
TTL(col.field).

* Add a 'writetime_ttl_individual_element' cluster feature flag that
  guards usage of the new wire format during rolling upgrades: the
  extended format is only emitted and consumed when every node in the
  cluster supports it.

* Implement serialize_for_cql_with_timestamps() (types/types.cc), a
  variant of serialize_for_cql() that appends a per-element section to
  the regular CQL bytes, listing each live element's serialized key,
  timestamp, and expiry.  The format is:
    [uint32 cql_len][cql bytes]
    [int32  entry_count]
    [per entry: (int32 key_len)(key bytes)(int64 timestamp)(int64 expiry)]
  expiry is -1 when the element has no TTL.

* Add partition_slice::option::send_collection_timestamps and modify
  write_cell() (mutation_partition.cc) to use the new function
  serialize_for_cql_with_timestamps() when this option is available.

This commit stands alone with no user-visible effect: nothing yet sets
the new partition-slice option.  The next patch adds the selection-layer
code that sets the option and parses the extended response.
2026-04-12 11:49:06 +03:00
Pavel Emelyanov
a1ea553fe1 code: Replace distributed<> with sharded<>
The latter is recommended in seastar, and the former was left as
compatibility alias. Latest seastar explicitly marks it as deprecated so
once the submodule is updated, compilation logs will explode.

Most of the patch is generated with

    for f in $(git grep -l '\<distributed<[A-Za-z0-9:_]*>') ; do sed -e 's/\<distributed<\([A-Za-z0-9:_]*\)>/sharded<\1>/g' -i $f; done
    for f in $(git grep -l distributed.hh); do sed -e 's/distributed.hh/sharded.hh/' -i $f ; done

and a small manual change in test/perf/perf.hh

Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>

Closes scylladb/scylladb#26136
2025-09-19 12:22:51 +02:00
Ernest Zaslavsky
d6aa04b88a serialization: Eliminate cql_serialization_format.hh
Eliminate `cql_serialization_format.hh` file by inlining it into `query-request.hh` header since the content is not used anywhere but
the aforementioned header

Removed files:
 - cql_serialization_format.hh

Fixes: #22108

This is a cleanup, no need to backport

Closes scylladb/scylladb#25087
2025-09-18 13:17:56 +03:00
Ernest Zaslavsky
d624413ddd treewide: Move query related files to a new query directory
As requested in #22120, moved the files and fixed other includes and build system.

Moved files:
- query.cc
- query-request.hh
- query-result.hh
- query-result-reader.hh
- query-result-set.cc
- query-result-set.hh
- query-result-writer.hh
- query_id.hh
- query_result_merger.hh

Fixes: #22120

This is a cleanup, no need to backport

Closes scylladb/scylladb#25105
2025-09-16 23:40:47 +03:00