Unverified Commit 69251f99 authored by vercel-fleet-prod[bot]'s avatar vercel-fleet-prod[bot] Committed by GitHub

Share state snapshot type with backing storage

Co-authored-by: 's avatarLuke Sandberg <210140+lukesandberg@users.noreply.github.com>
parent 929f1f5a
...@@ -234,7 +234,7 @@ impl SnapshotReason { ...@@ -234,7 +234,7 @@ impl SnapshotReason {
/// A compact snapshot of the (rare) independent state slots. Transient owners /// A compact snapshot of the (rare) independent state slots. Transient owners
/// and transient reader ids must not cross a restart. /// and transient reader ids must not cross a restart.
type StateSnapshot = Vec<(StateKey, Vec<u8>, Vec<TaskId>, Option<u64>)>; pub(crate) type StateSnapshot = Vec<(StateKey, Vec<u8>, Vec<TaskId>, Option<u64>)>;
struct StateEntry { struct StateEntry {
value: Vec<u8>, value: Vec<u8>,
......
...@@ -10,7 +10,7 @@ use smallvec::SmallVec; ...@@ -10,7 +10,7 @@ use smallvec::SmallVec;
use turbo_bincode::{new_turbo_bincode_decoder, turbo_bincode_decode, turbo_bincode_encode}; use turbo_bincode::{new_turbo_bincode_decoder, turbo_bincode_decode, turbo_bincode_encode};
use turbo_persistence::CommitStats; use turbo_persistence::CommitStats;
use turbo_tasks::{ use turbo_tasks::{
DynTaskInputs, RawVc, StateKey, TaskId, DynTaskInputs, RawVc, TaskId,
macro_helpers::NativeFunction, macro_helpers::NativeFunction,
panic_hooks::{PanicHookGuard, register_panic_hook}, panic_hooks::{PanicHookGuard, register_panic_hook},
parallel, parallel,
...@@ -18,7 +18,7 @@ use turbo_tasks::{ ...@@ -18,7 +18,7 @@ use turbo_tasks::{
use crate::{ use crate::{
GitVersionInfo, GitVersionInfo,
backend::{SpecificTaskDataCategory, TtlCounter, storage_schema::TaskStorage}, backend::{SpecificTaskDataCategory, StateSnapshot, TtlCounter, storage_schema::TaskStorage},
backing_storage::{SnapshotItem, SnapshotMeta, compute_task_type_hash_from_components}, backing_storage::{SnapshotItem, SnapshotMeta, compute_task_type_hash_from_components},
database::{ database::{
db_invalidation::{StartupCacheState, check_db_invalidation_and_cleanup, invalidate_db}, db_invalidation::{StartupCacheState, check_db_invalidation_and_cleanup, invalidate_db},
...@@ -250,7 +250,7 @@ impl TurboBackingStorage { ...@@ -250,7 +250,7 @@ impl TurboBackingStorage {
get(&self.inner.database).context("Unable to read GC roots from database") get(&self.inner.database).context("Unable to read GC roots from database")
} }
pub(crate) fn load_states(&self) -> Result<Vec<(StateKey, Vec<u8>, Vec<TaskId>, Option<u64>)>> { pub(crate) fn load_states(&self) -> Result<StateSnapshot> {
let Some(bytes) = self let Some(bytes) = self
.inner .inner
.database .database
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment