Skip to content

Commit

Permalink
feat(cubestore): Upgrade rust to 1.77.0-nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
ovr committed Jan 10, 2024
1 parent f29c592 commit 10747d2
Show file tree
Hide file tree
Showing 20 changed files with 32 additions and 89 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/birdbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ jobs:
run: rustup set auto-self-update disable
if: contains(runner.os, 'windows')
shell: bash
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2022-06-22
override: true
components: rustfmt
- name: Install Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
Expand Down Expand Up @@ -101,12 +95,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2022-06-22
override: true
components: rustfmt
- name: Install Node.js 16.x
uses: actions/setup-node@v3
with:
Expand Down Expand Up @@ -170,12 +158,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2022-06-22
override: true
components: rustfmt
- name: Install Node.js 16.x
uses: actions/setup-node@v3
with:
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/cloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,6 @@ jobs:
run: rustup set auto-self-update disable
if: contains(runner.os, 'windows')
shell: bash
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2022-06-22
override: true
components: rustfmt
- name: Install Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/drivers-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2022-06-22
override: true
components: rustfmt

- name: Install Node.js 16.x
uses: actions/setup-node@v3
with:
Expand Down
14 changes: 0 additions & 14 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -732,13 +732,6 @@ jobs:
run: rustup set auto-self-update disable
if: contains(runner.os, 'windows')
shell: bash
- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2022-06-22
target: ${{ matrix.target }}
override: true
components: rustfmt
- uses: Swatinem/rust-cache@v2
with:
workspaces: ./rust/cubestore -> target
Expand Down Expand Up @@ -819,13 +812,6 @@ jobs:
run: rustup set auto-self-update disable
if: contains(runner.os, 'windows')
shell: bash
- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2022-06-22
target: ${{ matrix.target }}
override: true
components: rustfmt
- uses: Swatinem/rust-cache@v2
with:
workspaces: ./rust/cubestore -> target
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,6 @@ jobs:
df -h
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2022-06-22
override: true
components: rustfmt
- uses: Swatinem/rust-cache@v2
with:
workspaces: ./rust/cubestore -> target
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/rust-cubesql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,6 @@ jobs:
with:
# pulls all commits (needed for codecov)
fetch-depth: 2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2022-06-22
override: true
components: rustfmt
- uses: Swatinem/rust-cache@v2
with:
workspaces: ./rust/cubesql -> target
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/rust-cubestore-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
rust: [nightly-2022-06-22]
rust: [nightly-2024-01-09]
env:
RUST: ${{ matrix.rust }}
steps:
Expand Down Expand Up @@ -237,7 +237,7 @@ jobs:
- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2022-06-22
toolchain: nightly-2024-01-09
target: ${{ matrix.target }}
override: true
components: rustfmt
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/rust-cubestore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
fail-fast: false
matrix:
rust: [nightly-2022-06-22]
rust: [nightly-2024-01-09]
env:
RUST: ${{ matrix.rust }}
steps:
Expand Down Expand Up @@ -178,7 +178,7 @@ jobs:
- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2022-06-22
toolchain: nightly-2024-01-09
target: ${{ matrix.target }}
override: true
components: rustfmt
Expand Down
21 changes: 11 additions & 10 deletions rust/cubestore/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions rust/cubestore/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM rust:1-bullseye as builder

RUN rustup update && \
rustup default nightly-2022-06-22 && \
rustup component add --toolchain nightly-2022-06-22 rustfmt;
rustup default nightly-2024-01-10 && \
rustup component add --toolchain nightly-2024-01-10 rustfmt;

RUN apt update \
&& apt upgrade -y \
Expand Down
2 changes: 1 addition & 1 deletion rust/cubestore/cubehll/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1196,7 +1196,7 @@ fn alpha(index_bit_len: u8) -> f64 {
4 => 0.673,
5 => 0.697,
6 => 0.709,
_ => (0.7213 / (1. + 1.079 / number_of_buckets(index_bit_len) as f64)),
_ => 0.7213 / (1. + 1.079 / number_of_buckets(index_bit_len) as f64),
};
}

Expand Down
3 changes: 2 additions & 1 deletion rust/cubestore/cubestore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ libc = { version = "0.2.97", optional = true }
[dependencies]
base64 = "0.13.0"
bumpalo = "3.6.1"
tokio = { version = "1.0", features = ["full", "rt"] }
tokio = { version = "1", features = ["full", "rt"] }
warp = { version = "0.3.6" }
sqlparser = { git = 'https://github.com/cube-js/sqlparser-rs.git', rev = "4388f6712dae5073c2d71d74f64cae2edd418066" }
serde_derive = "1.0.115"
Expand Down Expand Up @@ -74,6 +74,7 @@ tempfile = "3.2.0"
tarpc = { version = "0.24", features = ["tokio1"] }
pin-project-lite = "0.2.4"
paste = "1.0.4"
memchr = "2"
flatbuffers = "23.1.21"
http-auth-basic = "0.1.2"
tracing = "0.1.25"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ impl CacheEvictionManager {
raw_size,
}) => {
let mut ttl_buffer = ttl_buffer_to_move.blocking_write();
if let Some(mut cache_data) = ttl_buffer.get_mut(&row_id) {
if let Some(cache_data) = ttl_buffer.get_mut(&row_id) {
let expired_lfu = if let Some(previous_lru) =
cache_data.lru.decode_value_as_opt_datetime().unwrap()
{
Expand Down
2 changes: 1 addition & 1 deletion rust/cubestore/cubestore/src/cluster/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1094,7 +1094,7 @@ impl ClusterImpl {
on_socket_bound: oneshot::Sender<()>,
process_fn: impl Fn(Arc<ClusterImpl>, TcpStream) -> F + Send + Sync + Clone + 'static,
) -> Result<(), CubeError> {
let listener = TcpListener::bind(address.clone()).await?;
let listener = TcpListener::bind(address).await?;
let _ = on_socket_bound.send(());

info!("{} port open on {}", name, address);
Expand Down
6 changes: 3 additions & 3 deletions rust/cubestore/cubestore/src/import/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use core::mem;
use core::slice::memchr;
use memchr;
use std::convert::TryFrom;
use std::path::Path;
use std::pin::Pin;
Expand Down Expand Up @@ -567,7 +567,7 @@ impl ImportServiceImpl {
Ok((temp_file, None))
} else {
Ok((
File::open(location.clone()).await.map_err(|e| {
File::open(location).await.map_err(|e| {
CubeError::internal(format!("Open location {}: {}", location, e))
})?,
None,
Expand Down Expand Up @@ -681,7 +681,7 @@ impl ImportServiceImpl {
})?;

let (file, tmp_path) = self
.resolve_location(location.clone(), table.get_id(), &temp_dir)
.resolve_location(location, table.get_id(), &temp_dir)
.await?;
let mut row_stream = format
.row_stream(
Expand Down
5 changes: 1 addition & 4 deletions rust/cubestore/cubestore/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
#![feature(test)]
#![feature(backtrace)]
#![feature(async_closure)]
#![feature(drain_filter)]
#![feature(box_patterns)]
#![feature(slice_internals)]
#![feature(vec_into_raw_parts)]
#![feature(hash_set_entry)]
#![feature(map_first_last)]
#![feature(is_sorted)]
#![feature(result_flattening)]
#![feature(extract_if)]
// #![feature(trace_macros)]

// trace_macros!(true);
Expand Down
4 changes: 3 additions & 1 deletion rust/cubestore/cubestore/src/metastore/listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,13 @@ impl MetastoreListenerImpl {
async fn process_event(&self, event: MetaStoreEvent) -> Result<(), CubeError> {
let mut wait_fns = self.wait_fns.lock().await;
let to_notify = wait_fns
.drain_filter(|(_, wait_fn)| wait_fn(event.clone()))
.extract_if(|(_, wait_fn)| wait_fn(event.clone()))
.collect::<Vec<_>>();

for (notify, _) in to_notify {
notify.notify_waiters();
}

Ok(())
}
}
2 changes: 1 addition & 1 deletion rust/cubestore/cubestore/src/metastore/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1588,7 +1588,7 @@ impl RocksMetaStore {
}

taken[i] = true;
index_columns.push(c.clone().replace_index(index_columns.len()));
index_columns.push(c.replace_index(index_columns.len()));
}

let seq_column = table_id.get_row().seq_column().ok_or_else(|| {
Expand Down
3 changes: 1 addition & 2 deletions rust/cubestore/cubestore/src/sql/cachestore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -575,10 +575,9 @@ impl CacheStoreSqlService {

if track_time {
app_metrics::QUEUE_QUERY_TIME_MS.report(execution_time.as_millis() as i64);
log::debug!("Queue command processing time: {:?}", execution_time);
}

log::debug!("Queue command processing time: {:?}", execution_time,);

Ok(result)
}
}
Expand Down
2 changes: 1 addition & 1 deletion rust/cubestore/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "nightly-2022-06-22"
channel = "nightly-2024-01-09"
components = ["rustfmt", "rustc-dev", "clippy"]
profile = "minimal"

0 comments on commit 10747d2

Please sign in to comment.