Restrict one before range

This commit is contained in:
Dominik Werder
2025-07-04 17:32:26 +02:00
parent 9ac95a7866
commit cb382d2370
3 changed files with 12 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
[package]
name = "daqretrieve"
version = "0.5.5-aa.18"
version = "0.5.5"
authors = ["Dominik Werder <dominik.werder@gmail.com>"]
edition = "2024"

View File

@@ -918,6 +918,13 @@ async fn read_lsp_all(
jobtrace: &mut ReadJobTrace,
) -> Result<(Vec<DtNano>,), Error> {
let selfname = "read_lsp_all";
let lsp_max = if opts.ts_msp.ns() >= opts.range.beg() {
// TODO should not happen
// TODO metrics
return Ok((Vec::new(),));
} else {
opts.range.beg().delta(opts.ts_msp.ns())
};
let mut qu = stmts
.rt(&opts.rt)
.lsp_all()
@@ -933,7 +940,9 @@ async fn read_lsp_all(
let mut it = res.rows_stream::<(i64,)>()?;
while let Some(row) = it.try_next().await? {
let lsp = DtNano::from_ns(row.0 as u64);
ret.push(lsp);
if lsp < lsp_max {
ret.push(lsp);
}
}
Ok((ret,))
}

View File

@@ -365,9 +365,7 @@ async fn find_ts_msp_bck(
Ok(ret)
}
/*
Workaround because scylla's order by desc is broken at the moment.
*/
// Workaround because scylla's order by desc is broken at the moment.
async fn find_ts_msp_bck_workaround(
rt: &RetentionTime,
series: u64,