Skip to main content

kevy_embedded/
store.rs

1//! [`Store`] — the embedded entry point. Wraps `kevy_store::Store` with
2//! per-shard locks (for cross-thread access), optional AOF auto-logging, an
3//! optional background TTL reaper, and an in-process pub/sub bus.
4
5use std::io;
6use std::sync::atomic::{AtomicBool, Ordering};
7use std::sync::{Arc, Mutex, RwLock, RwLockReadGuard, RwLockWriteGuard, Weak};
8use std::thread::JoinHandle;
9
10use kevy_persist::{Aof, Argv};
11use kevy_store::ExpireStats;
12
13use crate::config::Config;
14use crate::pubsub::PubsubBus;
15use crate::shard::{build_shards, shard_idx};
16
17/// The keyspace shards (`hash(key) % n`), each a fully independent
18/// `kevy_store::Store` + AOF behind its own lock. `n == 1` (the default) is a
19/// one-element vec = the original single-lock store.
20pub(crate) type Shards = Arc<Vec<Arc<RwLock<Inner>>>>;
21
22/// The embedded keyspace.
23///
24/// **`Store` is `Clone`** (since v1.1.0). A clone is a cheap `Arc` bump:
25/// every clone reaches the same underlying shards + AOF + reaper + pub/sub
26/// bus. The reaper thread is joined and each shard's AOF is flushed exactly
27/// once, when the **last** clone is dropped.
28///
29/// ```
30/// use kevy_embedded::{Config, Store};
31///
32/// # fn main() -> std::io::Result<()> {
33/// let s = Store::open(Config::default().with_ttl_reaper_manual())?;
34/// let s2 = s.clone();
35/// std::thread::spawn(move || {
36///     s2.set(b"from-thread", b"v").unwrap();
37/// }).join().unwrap();
38/// assert_eq!(s.get(b"from-thread")?, Some(b"v".to_vec()));
39/// # Ok(())
40/// # }
41/// ```
42///
43/// Every method takes `&self`. Sharding (see [`Config::with_shards`]) lets a
44/// multi-threaded consumer scale across cores; pub/sub is process-wide
45/// (handled on shard 0).
46#[derive(Clone)]
47pub struct Store {
48    pub(crate) shards: Shards,
49    /// Shared drop guard: signals + joins reaper and flushes AOFs when the
50    /// LAST `Store` clone (or `Subscription`) holding a strong ref drops.
51    pub(crate) guard: Arc<DropGuard>,
52    pub(crate) config: Config,
53    /// v2.3 CDC feed handle (read API side); shards carry clones for
54    /// the write side. `None` = feed off (or wasm).
55    #[cfg(not(target_arch = "wasm32"))]
56    pub(crate) feed: Option<std::sync::Arc<Mutex<kevy_replicate::feed::FeedSource>>>,
57    /// v2.4 blocking-pop wake channel (always present; writers pay one
58    /// Relaxed load while nobody blocks).
59    pub(crate) blocker: Arc<crate::ops_blocking::Blocker>,
60    /// v2.5 index registry (catalog + version).
61    pub(crate) indexes: Arc<crate::ops_index::IndexReg>,
62    /// v2.6 view registry.
63    pub(crate) views: Arc<crate::ops_view::ViewReg>,
64}
65
66/// Weak handle to a `Store` — does not keep the underlying keyspace alive.
67///
68/// Used by the URL-keyed registry in `kevy-client` so that multiple
69/// `Connection::open("mem://name")` calls share the same backing store
70/// without leaking it when all strong handles go away.
71#[derive(Clone)]
72pub struct WeakStore {
73    shards: Weak<Vec<Arc<RwLock<Inner>>>>,
74    guard: Weak<DropGuard>,
75    config: Config,
76    #[cfg(not(target_arch = "wasm32"))]
77    feed_weak: Option<std::sync::Weak<Mutex<kevy_replicate::feed::FeedSource>>>,
78    blocker_weak: Weak<crate::ops_blocking::Blocker>,
79    indexes_weak: Weak<crate::ops_index::IndexReg>,
80    views_weak: Weak<crate::ops_view::ViewReg>,
81}
82
83impl WeakStore {
84    /// Try to upgrade back to a `Store`. Returns `None` if the last strong
85    /// reference has already been dropped.
86    pub fn upgrade(&self) -> Option<Store> {
87        Some(Store {
88            shards: self.shards.upgrade()?,
89            guard: self.guard.upgrade()?,
90            config: self.config.clone(),
91            #[cfg(not(target_arch = "wasm32"))]
92            feed: self.feed_weak.as_ref().and_then(std::sync::Weak::upgrade),
93            blocker: self.blocker_weak.upgrade()?,
94            indexes: self.indexes_weak.upgrade()?,
95            views: self.views_weak.upgrade()?,
96        })
97    }
98}
99
100pub(crate) struct Inner {
101    pub(crate) store: kevy_store::Store,
102    pub(crate) aof: Option<Aof>,
103    /// Pub/sub bus. Only shard 0's is ever used (pub/sub is process-wide);
104    /// other shards carry an idle one (cheap).
105    pub(crate) bus: PubsubBus,
106    /// Shared replication source if this store is an embed-as-writer.
107    /// Every shard holds a clone of the same `Arc<Mutex<...>>` so
108    /// `commit_write` can push mutations without reaching back up
109    /// through the `DropGuard`.
110    #[cfg(not(target_arch = "wasm32"))]
111    pub(crate) writer_source:
112        Option<std::sync::Arc<Mutex<kevy_replicate::source::ReplicationSource>>>,
113    /// v2.3 CDC feed (one stream per store); every shard holds a clone
114    /// so `commit_write` pushes effects inline. `None` = feed off.
115    #[cfg(not(target_arch = "wasm32"))]
116    pub(crate) feed: Option<std::sync::Arc<Mutex<kevy_replicate::feed::FeedSource>>>,
117    /// v2.4 blocking-pop wake channel clone (see `Store::blocker`).
118    pub(crate) blocker: Option<Arc<crate::ops_blocking::Blocker>>,
119    /// v2.5: this shard's index segments + the store-level registry
120    /// handle (for the commit_write hook).
121    pub(crate) idx_segs: crate::ops_index::ShardSegs,
122    pub(crate) idx_reg: Option<Arc<crate::ops_index::IndexReg>>,
123    /// v2.6: this shard's view states + registry handle.
124    pub(crate) view_segs: crate::ops_view::ShardViews,
125    pub(crate) view_reg: Option<Arc<crate::ops_view::ViewReg>>,
126}
127
128impl Inner {
129    pub(crate) fn new(store: kevy_store::Store, aof: Option<Aof>) -> Self {
130        Inner {
131            store,
132            aof,
133            bus: PubsubBus::new(),
134            #[cfg(not(target_arch = "wasm32"))]
135            writer_source: None,
136            #[cfg(not(target_arch = "wasm32"))]
137            feed: None,
138            blocker: None,
139            idx_segs: crate::ops_index::ShardSegs::default(),
140            idx_reg: None,
141            view_segs: crate::ops_view::ShardViews::default(),
142            view_reg: None,
143        }
144    }
145}
146
147/// Owns the reaper-thread handle + the shards for the final AOF flush. Lives
148/// in an `Arc<DropGuard>` shared across every `Store` clone; the drop logic
149/// fires only when the last clone goes away.
150pub(crate) struct DropGuard {
151    reaper_stop: Option<Arc<AtomicBool>>,
152    reaper_join: Mutex<Option<JoinHandle<()>>>,
153    shards_for_flush: Shards,
154    /// Replica runner thread + reconnect machinery, present iff this
155    /// store was opened with `Config::replica_upstream = Some(...)`.
156    /// Joined here so the runner stops cleanly when the last `Store`
157    /// clone goes away.
158    #[cfg(not(target_arch = "wasm32"))]
159    pub(crate) replica_runner: Option<crate::replica_runner::ReplicaRunner>,
160    /// v2.3: feed close-marker inputs — the feed handle + data dir,
161    /// present iff feed enabled AND persistent. Written after the AOF
162    /// flush so the marker's cursor describes durable state.
163    #[cfg(not(target_arch = "wasm32"))]
164    pub(crate) feed_close: Option<(
165        std::sync::Arc<Mutex<kevy_replicate::feed::FeedSource>>,
166        std::path::PathBuf,
167    )>,
168    /// Replica-source listener + accepted connection threads, present
169    /// iff this store is an embed-as-writer
170    /// (`Config::embed_writer_listen_addr = Some(...)`). Joined on
171    /// last-clone drop.
172    #[cfg(not(target_arch = "wasm32"))]
173    pub(crate) replica_source: Option<crate::replica_source::ReplicaSource>,
174}
175
176impl Store {
177    /// Open an embedded keyspace per `config`.
178    ///
179    /// - Pure in-memory when `config.data_dir` is `None`.
180    /// - With persistence: each shard loads its snapshot then replays its AOF
181    ///   (`config.shards > 1` re-shards a legacy single AOF on first open).
182    /// - Spawns a background TTL reaper thread when
183    ///   `config.ttl_reaper == Background` (the default).
184    /// - When `config.replica_upstream = Some("host:port")`, spawns a
185    ///   background thread that streams replication frames from the
186    ///   named primary and applies them to this store; local writes are
187    ///   rejected with `READONLY` (see [`Self::open_replica`]).
188    pub fn open(config: Config) -> io::Result<Self> {
189        let shards: Shards = Arc::new(build_shards(&config)?);
190        let (reaper_stop, reaper_join) = crate::reaper::spawn_reaper(&config, &shards)?;
191        #[cfg(not(target_arch = "wasm32"))]
192        let replica_runner = crate::replica_glue::spawn_replica_runner(&config, &shards);
193        #[cfg(not(target_arch = "wasm32"))]
194        let replica_source = match config.embed_writer_listen_addr.as_ref() {
195            Some(addr) => {
196                // Snapshot provider (v3.2): freeze every shard's COW
197                // view under the source lock (so ack_offset and the
198                // frozen keyspace are one point in time — writes
199                // between the two would replay twice otherwise), then
200                // serialize outside the locks via the persist writer.
201                let shards_for_snap: Shards = Arc::clone(&shards);
202                let snapshot: crate::replica_source::SnapshotProvider =
203                    Arc::new(move || crate::replica_source::freeze_and_serialize(&shards_for_snap));
204                let rs = crate::replica_source::ReplicaSource::spawn(
205                    addr,
206                    config.embed_writer_backlog_bytes,
207                    snapshot,
208                )?;
209                // Inject the shared source Arc into every shard's
210                // Inner so `commit_write` pushes mutations into the
211                // backlog inline. Done once at open under the
212                // shard's write lock; reads of `Inner::writer_source`
213                // afterwards are uncontended.
214                let shared = rs.shared_source();
215                for shard in shards.iter() {
216                    let mut g = lock_write(shard);
217                    g.writer_source = Some(shared.clone());
218                }
219                Some(rs)
220            }
221            None => None,
222        };
223        #[cfg(not(target_arch = "wasm32"))]
224        let feed = Store::feed_open(&config)?;
225        #[cfg(not(target_arch = "wasm32"))]
226        if let Some(f) = &feed {
227            for shard in shards.iter() {
228                let mut g = lock_write(shard);
229                g.feed = Some(f.clone());
230            }
231        }
232        let blocker = Arc::new(crate::ops_blocking::Blocker::new());
233        let indexes = Arc::new(crate::ops_index::IndexReg::default());
234        let views = Arc::new(crate::ops_view::ViewReg::default());
235        for shard in shards.iter() {
236            let mut g = lock_write(shard);
237            g.blocker = Some(blocker.clone());
238            g.idx_reg = Some(indexes.clone());
239            g.view_reg = Some(views.clone());
240        }
241        let guard = Arc::new(DropGuard {
242            reaper_stop,
243            reaper_join: Mutex::new(reaper_join),
244            shards_for_flush: shards.clone(),
245            #[cfg(not(target_arch = "wasm32"))]
246            replica_runner,
247            #[cfg(not(target_arch = "wasm32"))]
248            feed_close: match (&feed, &config.data_dir) {
249                (Some(f), Some(d)) => Some((f.clone(), d.clone())),
250                _ => None,
251            },
252            #[cfg(not(target_arch = "wasm32"))]
253            replica_source,
254        });
255        let store = Store {
256            shards,
257            guard,
258            config,
259            #[cfg(not(target_arch = "wasm32"))]
260            feed,
261            blocker,
262            indexes,
263            views,
264        };
265        store.idx_boot();
266        store.view_boot();
267        #[cfg(not(target_arch = "wasm32"))]
268        if let Some(addr) = store.config.resp_listener {
269            crate::listener::spawn(addr, store.downgrade())?;
270        }
271        Ok(store)
272    }
273
274    /// Convenience constructor for an embed-as-read-replica store
275    /// streaming writes from `upstream` (`"host:port"` of a kevy
276    /// server's replication listener).
277    ///
278    /// The replica:
279    /// - has its local AOF force-disabled (the upstream stream is the
280    ///   source of truth; replica AOF would diverge and double-apply
281    ///   on restart);
282    /// - rejects every local write with a `READONLY` `io::Error`
283    ///   (you can still call read APIs concurrently);
284    /// - reconnects with exponential backoff on disconnect, resuming
285    ///   from the last applied offset;
286    /// - gets a process-unique `replica_id` so an open / drop / reopen
287    ///   cycle within the primary's reconnect window does not look like
288    ///   the same slot from the primary's POV (which would evict
289    ///   backlog frames the new embed still needs from offset 0).
290    ///   Override via [`Config::with_replica_id`] when you specifically
291    ///   want the slot to be re-claimed across restarts.
292    ///
293    /// For full builder control (custom replica id, backoff bounds,
294    /// snapshot dir, etc.) use [`Self::open`] with
295    /// [`Config::with_replica_upstream`] + the related setters
296    /// instead.
297    #[cfg(not(target_arch = "wasm32"))]
298    pub fn open_replica(upstream: impl Into<String>) -> io::Result<Self> {
299        let cfg = Config::default()
300            .without_aof()
301            .with_replica_id(crate::replica_glue::fresh_replica_id())
302            .with_replica_upstream(upstream);
303        Self::open(cfg)
304    }
305
306    /// `true` when this store was opened against a replication
307    /// upstream — local writes are rejected with `READONLY`.
308    pub fn is_replica(&self) -> bool {
309        self.config.replica_upstream.is_some()
310    }
311
312    /// Retarget this replica at a new primary URL (`host:port`). The
313    /// runner picks up the change on its next connect — which is
314    /// forced now by `shutdown`ing the current socket clone, so the
315    /// retarget lands within `Config::replica_reconnect_min` (default
316    /// 100 ms) of this call.
317    ///
318    /// Returns `Err` with `ErrorKind::InvalidInput` when this store is
319    /// not a replica (no upstream was configured at open). Application
320    /// code typically drives this from a `kevy-elect` failover signal —
321    /// see [`docs/cluster.md`](https://github.com/goliajp/kevy/blob/develop/docs/cluster.md).
322    /// `kevy-embedded` itself stays elect-protocol-agnostic; the
323    /// integration glue lives in the application.
324    #[cfg(not(target_arch = "wasm32"))]
325    pub fn set_replica_upstream(&self, new_upstream: impl Into<String>) -> io::Result<()> {
326        if !self.is_replica() {
327            return Err(io::Error::new(
328                io::ErrorKind::InvalidInput,
329                "set_replica_upstream called on a non-replica store",
330            ));
331        }
332        let Some(runner) = self.guard.replica_runner.as_ref() else {
333            return Err(io::Error::new(
334                io::ErrorKind::InvalidInput,
335                "replica runner is not active (open was racy?)",
336            ));
337        };
338        runner.set_upstream(new_upstream.into());
339        Ok(())
340    }
341
342    /// Get a weak handle that does not keep the keyspace alive.
343    pub fn downgrade(&self) -> WeakStore {
344        WeakStore {
345            shards: Arc::downgrade(&self.shards),
346            guard: Arc::downgrade(&self.guard),
347            config: self.config.clone(),
348            #[cfg(not(target_arch = "wasm32"))]
349            feed_weak: self.feed.as_ref().map(Arc::downgrade),
350            blocker_weak: Arc::downgrade(&self.blocker),
351            indexes_weak: Arc::downgrade(&self.indexes),
352            views_weak: Arc::downgrade(&self.views),
353        }
354    }
355
356    /// The active config (a clone — modifying it has no effect on the
357    /// running store). Useful for introspection / `INFO`-style telemetry.
358    pub fn config(&self) -> &Config {
359        &self.config
360    }
361
362    // ---- escape hatches -------------------------------------------------
363
364    /// Run `f` against the underlying `kevy_store::Store` under its lock. Use
365    /// for direct access to methods this crate hasn't wrapped. The closure can
366    /// mutate, but *does not auto-log to the AOF* — call [`Self::log`] yourself
367    /// if the mutation must survive a crash.
368    ///
369    /// **Sharded stores:** this targets shard 0 only. Use [`Self::with_key`]
370    /// to reach the shard owning a specific key.
371    pub fn with<F, R>(&self, f: F) -> R
372    where
373        F: FnOnce(&mut kevy_store::Store) -> R,
374    {
375        let mut g = self.lock();
376        f(&mut g.store)
377    }
378
379    /// Like [`Self::with`] but targets the shard that owns `key`.
380    pub fn with_key<F, R>(&self, key: &[u8], f: F) -> R
381    where
382        F: FnOnce(&mut kevy_store::Store) -> R,
383    {
384        let mut g = self.wshard(key);
385        f(&mut g.store)
386    }
387
388    /// `KEYS` / `SCAN`-glob across **every shard** — the cross-shard
389    /// replacement for `with(|s| s.collect_keys(pat, lim))`, which only sees
390    /// shard 0 once sharding is on. Behaves identically to `with(...)` when
391    /// `shard_count() == 1`. `limit` bounds the *total* returned across shards.
392    /// Takes a read lock per shard (concurrent-safe).
393    pub fn collect_keys(&self, pattern: Option<&[u8]>, limit: Option<usize>) -> Vec<Vec<u8>> {
394        let mut out = Vec::new();
395        for shard in self.shards.iter() {
396            if limit.is_some_and(|l| out.len() >= l) {
397                break;
398            }
399            let remaining = limit.map(|l| l - out.len());
400            out.extend(lock_read(shard).store.collect_keys(pattern, remaining));
401        }
402        out
403    }
404
405    /// Run `f` against **each shard's** underlying `kevy_store::Store` (in
406    /// shard-index order) — the cross-shard escape hatch. The caller assembles
407    /// the merged result. Pairs with [`Self::shard_count`]. For a single key,
408    /// prefer [`Self::with_key`]; for a glob scan, prefer [`Self::collect_keys`].
409    pub fn for_each_shard<F: FnMut(&mut kevy_store::Store)>(&self, mut f: F) {
410        for shard in self.shards.iter() {
411            f(&mut lock_write(shard).store);
412        }
413    }
414
415    /// Number of keyspace shards (`== Config::shards`).
416    #[inline]
417    pub fn shard_count(&self) -> usize {
418        self.shards.len()
419    }
420
421    /// Append a raw RESP-frame argument list to the shard owning its key's
422    /// AOF. No-op when persistence is disabled.
423    pub fn log(&self, parts: &[&[u8]]) -> io::Result<()> {
424        let mut g = match parts.get(1) {
425            Some(key) => self.wshard(key),
426            None => self.lock(),
427        };
428        if let Some(aof) = &mut g.aof {
429            let argv = Argv::from(parts.iter().map(|p| p.to_vec()).collect::<Vec<_>>());
430            aof.append(&argv)?;
431        }
432        Ok(())
433    }
434
435    // ---- maintenance ----------------------------------------------------
436
437    /// Run one TTL-reaper tick across every shard. Required call cadence in
438    /// `Manual` mode (~10×/s to match Redis `hz=10`). Returns the summed stats.
439    pub fn tick(&self) -> ExpireStats {
440        let mut total = ExpireStats::default();
441        for shard in self.shards.iter() {
442            let stats = {
443                let mut g = lock_write(shard);
444                g.store.tick_expire(self.config.reaper_samples, self.config.reaper_max_rounds)
445            };
446            total.sampled += stats.sampled;
447            total.expired += stats.expired;
448            // Auto-rewrite rides the caller-driven tick in Manual mode; the
449            // non-blocking path releases the lock for the disk spill.
450            crate::reaper::concurrent_auto_rewrite(
451                shard,
452                self.config.auto_aof_rewrite_pct,
453                self.config.auto_aof_rewrite_min_size,
454                self.config.metric_sink.as_ref(),
455            );
456        }
457        total
458    }
459
460    // Durability methods (`rewrite_aof`, `save_snapshot`) live in
461    // `crate::store_persist` to keep this file under the 500-LOC
462    // project ceiling.
463    // Data-type methods live in `crate::ops` / `crate::info`.
464
465    /// Crate-internal: clone shard 0's handle for a `Subscription`'s bus.
466    pub(crate) fn inner_handle(&self) -> Arc<RwLock<Inner>> {
467        self.shards[0].clone()
468    }
469
470    /// Crate-internal: clone the shared `Arc<DropGuard>`.
471    pub(crate) fn guard_handle(&self) -> Arc<DropGuard> {
472        self.guard.clone()
473    }
474
475    fn shard_for(&self, key: &[u8]) -> &Arc<RwLock<Inner>> {
476        &self.shards[shard_idx(key, self.shards.len())]
477    }
478
479    /// Write-lock the shard owning `key`.
480    pub(crate) fn wshard(&self, key: &[u8]) -> RwLockWriteGuard<'_, Inner> {
481        lock_write(self.shard_for(key))
482    }
483
484    /// Read-lock the shard owning `key` (GET fast path — concurrent readers
485    /// across shards run in parallel).
486    pub(crate) fn rshard(&self, key: &[u8]) -> RwLockReadGuard<'_, Inner> {
487        lock_read(self.shard_for(key))
488    }
489
490    /// Write-lock shard 0 — pub/sub bus + keyless escape hatches.
491    pub(crate) fn lock(&self) -> RwLockWriteGuard<'_, Inner> {
492        lock_write(&self.shards[0])
493    }
494
495    /// Run `f` over every shard's write guard, summing a `usize` (DBSIZE etc.).
496    pub(crate) fn sum_shards<F: Fn(&mut Inner) -> usize>(&self, f: F) -> usize {
497        self.shards.iter().map(|s| f(&mut lock_write(s))).sum()
498    }
499
500    /// Run `f` over every shard's write guard, summing a `u64`.
501    pub(crate) fn sum_shards_u64<F: Fn(&mut Inner) -> u64>(&self, f: F) -> u64 {
502        self.shards.iter().map(|s| f(&mut lock_write(s))).sum()
503    }
504
505    /// Run a fallible `f` over every shard (mutating, e.g. FLUSHALL).
506    pub(crate) fn try_for_each_shard<F: FnMut(&mut Inner) -> io::Result<()>>(
507        &self,
508        mut f: F,
509    ) -> io::Result<()> {
510        for s in self.shards.iter() {
511            f(&mut lock_write(s))?;
512        }
513        Ok(())
514    }
515}
516
517
518pub(crate) use crate::store_glue::{commit_write, lock_read, lock_write, store_err};
519
520impl Drop for DropGuard {
521    fn drop(&mut self) {
522        // Stop the replica runner FIRST so no more frames arrive while
523        // we're shutting down + flushing the AOF (frames would race
524        // with the shutdown path).
525        #[cfg(not(target_arch = "wasm32"))]
526        if let Some(r) = &self.replica_runner {
527            r.shutdown();
528        }
529        // Stop the writer-source accept + connection threads next, so
530        // no new replica picks up bytes mid-flush.
531        #[cfg(not(target_arch = "wasm32"))]
532        if let Some(rs) = &self.replica_source {
533            rs.shutdown();
534        }
535        // Stop + join the reaper, then flush every shard's AOF so EverySec
536        // users don't lose the last sub-second of writes.
537        if let Some(stop) = &self.reaper_stop {
538            stop.store(true, Ordering::Relaxed);
539        }
540        if let Some(j) = self
541            .reaper_join
542            .lock()
543            .unwrap_or_else(std::sync::PoisonError::into_inner)
544            .take()
545        {
546            let _ = j.join();
547        }
548        for shard in self.shards_for_flush.iter() {
549            let mut g = lock_write(shard);
550            if let Some(aof) = &mut g.aof {
551                let _ = aof.maybe_sync();
552            }
553        }
554        // v2.3: with the AOF durable, record the feed continuity
555        // marker — the cursor now exactly describes on-disk state.
556        #[cfg(not(target_arch = "wasm32"))]
557        if let Some((feed, dir)) = &self.feed_close {
558            Store::feed_write_close_marker(feed, dir);
559        }
560    }
561}
562
563
564#[cfg(test)]
565#[path = "store_tests.rs"]
566mod tests;
567#[cfg(test)]
568#[path = "store_tests_shard.rs"]
569mod tests_shard;
570#[cfg(test)]
571#[path = "store_tests_p2.rs"]
572mod tests_p2;
573#[cfg(test)]
574#[path = "store_tests_p3.rs"]
575mod tests_p3;
576#[cfg(test)]
577#[path = "store_tests_bitmap.rs"]
578mod tests_bitmap;
579#[cfg(test)]
580#[path = "store_tests_bonus.rs"]
581mod tests_bonus;
582#[cfg(test)]
583#[path = "store_tests_scan.rs"]
584mod tests_scan;
585#[cfg(test)]
586#[path = "store_tests_atomic.rs"]
587mod tests_atomic;
588#[cfg(test)]
589#[path = "store_tests_more.rs"]
590mod tests_more;
591#[cfg(test)]
592#[path = "store_tests_keyspace.rs"]
593mod tests_keyspace;
594#[cfg(test)]
595#[path = "store_tests_atomic_all.rs"]
596mod tests_atomic_all;
597#[cfg(test)]
598#[path = "store_tests_replay_all.rs"]
599mod tests_replay_all;
600#[cfg(test)]
601#[path = "store_tests_op_table.rs"]
602mod tests_op_table;