Skip to content

Commit 7a797fa

Browse files
remove: local caching (#1069)
remove all traces of caching from the code removed cache from endpoints, metrics, stream info
1 parent 04a92b0 commit 7a797fa

File tree

10 files changed

+5
-65
lines changed

10 files changed

+5
-65
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ This section elaborates available options to run Parseable in production or deve
9393
## Features :rocket:
9494

9595
- [High availability & Cluster mode ↗︎](https://www.parseable.com/docs/concepts/distributed-architecture)
96-
- [Local cache ↗︎](https://www.parseable.com/docs/features/tiering)
96+
- [Hot Tier ↗︎](https://www.parseable.com/docs/features/tiering)
9797
- [Alerts ↗︎](https://www.parseable.com/docs/alerts)
9898
- [Role based access control ↗︎](https://www.parseable.com/docs/rbac)
9999
- [OAuth2 support ↗︎](https://www.parseable.com/docs/oidc)

src/handlers/http/about.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ use std::path::PathBuf;
3939
/// "license": "AGPL-3.0-only",
4040
/// "mode": mode,
4141
/// "staging": staging,
42-
/// "cache": cache_details,
4342
/// "grpcPort": grpc_port,
4443
/// "store": {
4544
/// "type": CONFIG.get_storage_mode_string(),

src/handlers/http/logstream.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,6 @@ pub async fn get_stream_info(req: HttpRequest) -> Result<impl Responder, StreamE
567567
.time_partition_limit
568568
.map(|limit| limit.to_string()),
569569
custom_partition: stream_meta.custom_partition.clone(),
570-
cache_enabled: stream_meta.cache_enabled,
571570
static_schema_flag: stream_meta.static_schema_flag.clone(),
572571
};
573572

src/handlers/http/modal/ingest_server.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ use super::OpenIdClient;
2525
use super::ParseableServer;
2626
use crate::analytics;
2727
use crate::handlers::airplane;
28-
use crate::handlers::http::caching_removed;
2928
use crate::handlers::http::ingest;
3029
use crate::handlers::http::logstream;
3130
use crate::handlers::http::middleware::DisAllowRootUser;
@@ -268,13 +267,6 @@ impl IngestServer {
268267
.authorize_for_stream(Action::GetStats),
269268
),
270269
)
271-
.service(
272-
web::resource("/cache")
273-
// PUT "/logstream/{logstream}/cache" ==> caching has been deprecated
274-
.route(web::put().to(caching_removed))
275-
// GET "/logstream/{logstream}/cache" ==> caching has been deprecated
276-
.route(web::get().to(caching_removed)),
277-
)
278270
.service(
279271
web::scope("/retention").service(
280272
web::resource("/cleanup").route(

src/handlers/http/modal/query_server.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818

1919
use crate::correlation::CORRELATIONS;
2020
use crate::handlers::airplane;
21+
use crate::handlers::http::base_path;
2122
use crate::handlers::http::cluster::{self, init_cluster_metrics_schedular};
2223
use crate::handlers::http::logstream::create_internal_stream_if_not_exists;
2324
use crate::handlers::http::middleware::{DisAllowRootUser, RouteExt};
2425
use crate::handlers::http::{self, role};
25-
use crate::handlers::http::{base_path, caching_removed};
2626
use crate::handlers::http::{logstream, MAX_EVENT_PAYLOAD_SIZE};
2727
use crate::hottier::HotTierManager;
2828
use crate::rbac::role::Action;
@@ -54,7 +54,6 @@ impl ParseableServer for QueryServer {
5454
.service(Server::get_correlation_webscope())
5555
.service(Server::get_query_factory())
5656
.service(Server::get_trino_factory())
57-
.service(Server::get_cache_webscope())
5857
.service(Server::get_liveness_factory())
5958
.service(Server::get_readiness_factory())
6059
.service(Server::get_about_factory())
@@ -331,13 +330,6 @@ impl QueryServer {
331330
.authorize_for_stream(Action::GetRetention),
332331
),
333332
)
334-
.service(
335-
web::resource("/cache")
336-
// PUT "/logstream/{logstream}/cache" ==> caching has been deprecated
337-
.route(web::put().to(caching_removed))
338-
// GET "/logstream/{logstream}/cache" ==> caching has been deprecated
339-
.route(web::get().to(caching_removed)),
340-
)
341333
.service(
342334
web::resource("/hottier")
343335
// PUT "/logstream/{logstream}/hottier" ==> Set hottier for given logstream

src/handlers/http/modal/server.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ use crate::correlation::CORRELATIONS;
2121
use crate::handlers;
2222
use crate::handlers::http::about;
2323
use crate::handlers::http::base_path;
24-
use crate::handlers::http::caching_removed;
2524
use crate::handlers::http::health_check;
2625
use crate::handlers::http::query;
2726
use crate::handlers::http::trino;
@@ -71,7 +70,6 @@ impl ParseableServer for Server {
7170
.service(Self::get_correlation_webscope())
7271
.service(Self::get_query_factory())
7372
.service(Self::get_trino_factory())
74-
.service(Self::get_cache_webscope())
7573
.service(Self::get_ingest_factory())
7674
.service(Self::get_liveness_factory())
7775
.service(Self::get_readiness_factory())
@@ -282,18 +280,6 @@ impl Server {
282280
web::resource("/query").route(web::post().to(query::query).authorize(Action::Query))
283281
}
284282

285-
pub fn get_cache_webscope() -> Scope {
286-
web::scope("/cache").service(
287-
web::scope("/{user_id}").service(
288-
web::scope("/{stream}").service(
289-
web::resource("")
290-
.route(web::get().to(caching_removed))
291-
.route(web::post().to(caching_removed)),
292-
),
293-
),
294-
)
295-
}
296-
297283
// get the logstream web scope
298284
pub fn get_logstream_webscope() -> Scope {
299285
web::scope("/logstream")
@@ -391,13 +377,6 @@ impl Server {
391377
.authorize_for_stream(Action::GetRetention),
392378
),
393379
)
394-
.service(
395-
web::resource("/cache")
396-
// PUT "/logstream/{logstream}/cache" ==> Set retention for given logstream
397-
.route(web::put().to(caching_removed))
398-
// GET "/logstream/{logstream}/cache" ==> Get retention for given logstream
399-
.route(web::get().to(caching_removed)),
400-
)
401380
.service(
402381
web::resource("/hottier")
403382
// PUT "/logstream/{logstream}/hottier" ==> Set hottier for given logstream

src/metadata.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ pub struct LogStreamMetadata {
6767
pub schema: HashMap<String, Arc<Field>>,
6868
pub alerts: Alerts,
6969
pub retention: Option<Retention>,
70-
pub cache_enabled: bool,
7170
pub created_at: String,
7271
pub first_event_at: Option<String>,
7372
pub time_partition: Option<String>,
@@ -430,7 +429,6 @@ pub async fn load_stream_metadata_on_server_start(
430429
created_at,
431430
first_event_at,
432431
retention,
433-
cache_enabled,
434432
snapshot,
435433
stats,
436434
time_partition,
@@ -467,7 +465,6 @@ pub async fn load_stream_metadata_on_server_start(
467465
schema,
468466
alerts,
469467
retention,
470-
cache_enabled,
471468
created_at,
472469
first_event_at,
473470
time_partition,

src/metrics/prom_utils.rs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ pub struct Metrics {
5050
event_time: NaiveDateTime,
5151
commit: String,
5252
staging: String,
53-
cache: String,
5453
}
5554

5655
#[derive(Debug, Serialize, Default, Clone)]
@@ -85,7 +84,6 @@ impl Default for Metrics {
8584
event_time: Utc::now().naive_utc(),
8685
commit: "".to_string(),
8786
staging: "".to_string(),
88-
cache: "".to_string(),
8987
}
9088
}
9189
}
@@ -109,7 +107,6 @@ impl Metrics {
109107
event_time: Utc::now().naive_utc(),
110108
commit: "".to_string(),
111109
staging: "".to_string(),
112-
cache: "".to_string(),
113110
}
114111
}
115112
}
@@ -206,7 +203,7 @@ impl Metrics {
206203
}
207204
}
208205
}
209-
let (commit_id, staging, cache) = Self::from_about_api_response(ingestor_metadata.clone())
206+
let (commit_id, staging) = Self::from_about_api_response(ingestor_metadata.clone())
210207
.await
211208
.map_err(|err| {
212209
error!("Fatal: failed to get ingestor info: {:?}", err);
@@ -215,14 +212,13 @@ impl Metrics {
215212

216213
prom_dress.commit = commit_id;
217214
prom_dress.staging = staging;
218-
prom_dress.cache = cache;
219215

220216
Ok(prom_dress)
221217
}
222218

223219
pub async fn from_about_api_response(
224220
ingestor_metadata: IngestorMetadata,
225-
) -> Result<(String, String, String), PostError> {
221+
) -> Result<(String, String), PostError> {
226222
let uri = Url::parse(&format!(
227223
"{}{}/about",
228224
&ingestor_metadata.domain_name,
@@ -249,15 +245,7 @@ impl Metrics {
249245
.get("staging")
250246
.and_then(|x| x.as_str())
251247
.unwrap_or_default();
252-
let cache = about_api_json
253-
.get("cache")
254-
.and_then(|x| x.as_str())
255-
.unwrap_or_default();
256-
Ok((
257-
commit_id.to_string(),
258-
staging.to_string(),
259-
cache.to_string(),
260-
))
248+
Ok((commit_id.to_string(), staging.to_string()))
261249
} else {
262250
warn!(
263251
"Failed to fetch about API response from ingestor: {}\n",

src/option.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ use serde::{Deserialize, Serialize};
3030
use std::env;
3131
use std::path::PathBuf;
3232
use std::sync::Arc;
33-
pub const MIN_CACHE_SIZE_BYTES: u64 = 1073741824; // 1 GiB
3433

3534
pub const JOIN_COMMUNITY: &str =
3635
"Join us on Parseable Slack community for questions : https://logg.ing/community";

src/storage/mod.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,6 @@ pub struct ObjectStoreFormat {
9696
pub stats: FullStats,
9797
#[serde(default)]
9898
pub snapshot: Snapshot,
99-
#[serde(default)]
100-
pub cache_enabled: bool,
10199
#[serde(skip_serializing_if = "Option::is_none")]
102100
pub retention: Option<Retention>,
103101
#[serde(skip_serializing_if = "Option::is_none")]
@@ -120,8 +118,6 @@ pub struct StreamInfo {
120118
#[serde(rename = "first-event-at")]
121119
#[serde(skip_serializing_if = "Option::is_none")]
122120
pub first_event_at: Option<String>,
123-
#[serde(default)]
124-
pub cache_enabled: bool,
125121
#[serde(skip_serializing_if = "Option::is_none")]
126122
pub time_partition: Option<String>,
127123
#[serde(skip_serializing_if = "Option::is_none")]
@@ -191,7 +187,6 @@ impl Default for ObjectStoreFormat {
191187
permissions: vec![Permisssion::new("parseable".to_string())],
192188
stats: FullStats::default(),
193189
snapshot: Snapshot::default(),
194-
cache_enabled: false,
195190
retention: None,
196191
time_partition: None,
197192
time_partition_limit: None,

0 commit comments

Comments
 (0)