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 let rs = crate::replica_source::ReplicaSource::spawn(
197 addr,
198 config.embed_writer_backlog_bytes,
199 )?;
200 // Inject the shared source Arc into every shard's
201 // Inner so `commit_write` pushes mutations into the
202 // backlog inline. Done once at open under the
203 // shard's write lock; reads of `Inner::writer_source`
204 // afterwards are uncontended.
205 let shared = rs.shared_source();
206 for shard in shards.iter() {
207 let mut g = lock_write(shard);
208 g.writer_source = Some(shared.clone());
209 }
210 Some(rs)
211 }
212 None => None,
213 };
214 #[cfg(not(target_arch = "wasm32"))]
215 let feed = Store::feed_open(&config)?;
216 #[cfg(not(target_arch = "wasm32"))]
217 if let Some(f) = &feed {
218 for shard in shards.iter() {
219 let mut g = lock_write(shard);
220 g.feed = Some(f.clone());
221 }
222 }
223 let blocker = Arc::new(crate::ops_blocking::Blocker::new());
224 let indexes = Arc::new(crate::ops_index::IndexReg::default());
225 let views = Arc::new(crate::ops_view::ViewReg::default());
226 for shard in shards.iter() {
227 let mut g = lock_write(shard);
228 g.blocker = Some(blocker.clone());
229 g.idx_reg = Some(indexes.clone());
230 g.view_reg = Some(views.clone());
231 }
232 let guard = Arc::new(DropGuard {
233 reaper_stop,
234 reaper_join: Mutex::new(reaper_join),
235 shards_for_flush: shards.clone(),
236 #[cfg(not(target_arch = "wasm32"))]
237 replica_runner,
238 #[cfg(not(target_arch = "wasm32"))]
239 feed_close: match (&feed, &config.data_dir) {
240 (Some(f), Some(d)) => Some((f.clone(), d.clone())),
241 _ => None,
242 },
243 #[cfg(not(target_arch = "wasm32"))]
244 replica_source,
245 });
246 let store = Store {
247 shards,
248 guard,
249 config,
250 #[cfg(not(target_arch = "wasm32"))]
251 feed,
252 blocker,
253 indexes,
254 views,
255 };
256 store.idx_boot();
257 store.view_boot();
258 #[cfg(not(target_arch = "wasm32"))]
259 if let Some(addr) = store.config.resp_listener {
260 crate::listener::spawn(addr, store.downgrade())?;
261 }
262 Ok(store)
263 }
264
265 /// Convenience constructor for an embed-as-read-replica store
266 /// streaming writes from `upstream` (`"host:port"` of a kevy
267 /// server's replication listener).
268 ///
269 /// The replica:
270 /// - has its local AOF force-disabled (the upstream stream is the
271 /// source of truth; replica AOF would diverge and double-apply
272 /// on restart);
273 /// - rejects every local write with a `READONLY` `io::Error`
274 /// (you can still call read APIs concurrently);
275 /// - reconnects with exponential backoff on disconnect, resuming
276 /// from the last applied offset;
277 /// - gets a process-unique `replica_id` so an open / drop / reopen
278 /// cycle within the primary's reconnect window does not look like
279 /// the same slot from the primary's POV (which would evict
280 /// backlog frames the new embed still needs from offset 0).
281 /// Override via [`Config::with_replica_id`] when you specifically
282 /// want the slot to be re-claimed across restarts.
283 ///
284 /// For full builder control (custom replica id, backoff bounds,
285 /// snapshot dir, etc.) use [`Self::open`] with
286 /// [`Config::with_replica_upstream`] + the related setters
287 /// instead.
288 #[cfg(not(target_arch = "wasm32"))]
289 pub fn open_replica(upstream: impl Into<String>) -> io::Result<Self> {
290 let cfg = Config::default()
291 .without_aof()
292 .with_replica_id(crate::replica_glue::fresh_replica_id())
293 .with_replica_upstream(upstream);
294 Self::open(cfg)
295 }
296
297 /// `true` when this store was opened against a replication
298 /// upstream — local writes are rejected with `READONLY`.
299 pub fn is_replica(&self) -> bool {
300 self.config.replica_upstream.is_some()
301 }
302
303 /// Retarget this replica at a new primary URL (`host:port`). The
304 /// runner picks up the change on its next connect — which is
305 /// forced now by `shutdown`ing the current socket clone, so the
306 /// retarget lands within `Config::replica_reconnect_min` (default
307 /// 100 ms) of this call.
308 ///
309 /// Returns `Err` with `ErrorKind::InvalidInput` when this store is
310 /// not a replica (no upstream was configured at open). Application
311 /// code typically drives this from a `kevy-elect` failover signal —
312 /// see [`docs/cluster.md`](https://github.com/goliajp/kevy/blob/develop/docs/cluster.md).
313 /// `kevy-embedded` itself stays elect-protocol-agnostic; the
314 /// integration glue lives in the application.
315 #[cfg(not(target_arch = "wasm32"))]
316 pub fn set_replica_upstream(&self, new_upstream: impl Into<String>) -> io::Result<()> {
317 if !self.is_replica() {
318 return Err(io::Error::new(
319 io::ErrorKind::InvalidInput,
320 "set_replica_upstream called on a non-replica store",
321 ));
322 }
323 let Some(runner) = self.guard.replica_runner.as_ref() else {
324 return Err(io::Error::new(
325 io::ErrorKind::InvalidInput,
326 "replica runner is not active (open was racy?)",
327 ));
328 };
329 runner.set_upstream(new_upstream.into());
330 Ok(())
331 }
332
333 /// Get a weak handle that does not keep the keyspace alive.
334 pub fn downgrade(&self) -> WeakStore {
335 WeakStore {
336 shards: Arc::downgrade(&self.shards),
337 guard: Arc::downgrade(&self.guard),
338 config: self.config.clone(),
339 #[cfg(not(target_arch = "wasm32"))]
340 feed_weak: self.feed.as_ref().map(Arc::downgrade),
341 blocker_weak: Arc::downgrade(&self.blocker),
342 indexes_weak: Arc::downgrade(&self.indexes),
343 views_weak: Arc::downgrade(&self.views),
344 }
345 }
346
347 /// The active config (a clone — modifying it has no effect on the
348 /// running store). Useful for introspection / `INFO`-style telemetry.
349 pub fn config(&self) -> &Config {
350 &self.config
351 }
352
353 // ---- escape hatches -------------------------------------------------
354
355 /// Run `f` against the underlying `kevy_store::Store` under its lock. Use
356 /// for direct access to methods this crate hasn't wrapped. The closure can
357 /// mutate, but *does not auto-log to the AOF* — call [`Self::log`] yourself
358 /// if the mutation must survive a crash.
359 ///
360 /// **Sharded stores:** this targets shard 0 only. Use [`Self::with_key`]
361 /// to reach the shard owning a specific key.
362 pub fn with<F, R>(&self, f: F) -> R
363 where
364 F: FnOnce(&mut kevy_store::Store) -> R,
365 {
366 let mut g = self.lock();
367 f(&mut g.store)
368 }
369
370 /// Like [`Self::with`] but targets the shard that owns `key`.
371 pub fn with_key<F, R>(&self, key: &[u8], f: F) -> R
372 where
373 F: FnOnce(&mut kevy_store::Store) -> R,
374 {
375 let mut g = self.wshard(key);
376 f(&mut g.store)
377 }
378
379 /// `KEYS` / `SCAN`-glob across **every shard** — the cross-shard
380 /// replacement for `with(|s| s.collect_keys(pat, lim))`, which only sees
381 /// shard 0 once sharding is on. Behaves identically to `with(...)` when
382 /// `shard_count() == 1`. `limit` bounds the *total* returned across shards.
383 /// Takes a read lock per shard (concurrent-safe).
384 pub fn collect_keys(&self, pattern: Option<&[u8]>, limit: Option<usize>) -> Vec<Vec<u8>> {
385 let mut out = Vec::new();
386 for shard in self.shards.iter() {
387 if limit.is_some_and(|l| out.len() >= l) {
388 break;
389 }
390 let remaining = limit.map(|l| l - out.len());
391 out.extend(lock_read(shard).store.collect_keys(pattern, remaining));
392 }
393 out
394 }
395
396 /// Run `f` against **each shard's** underlying `kevy_store::Store` (in
397 /// shard-index order) — the cross-shard escape hatch. The caller assembles
398 /// the merged result. Pairs with [`Self::shard_count`]. For a single key,
399 /// prefer [`Self::with_key`]; for a glob scan, prefer [`Self::collect_keys`].
400 pub fn for_each_shard<F: FnMut(&mut kevy_store::Store)>(&self, mut f: F) {
401 for shard in self.shards.iter() {
402 f(&mut lock_write(shard).store);
403 }
404 }
405
406 /// Number of keyspace shards (`== Config::shards`).
407 #[inline]
408 pub fn shard_count(&self) -> usize {
409 self.shards.len()
410 }
411
412 /// Append a raw RESP-frame argument list to the shard owning its key's
413 /// AOF. No-op when persistence is disabled.
414 pub fn log(&self, parts: &[&[u8]]) -> io::Result<()> {
415 let mut g = match parts.get(1) {
416 Some(key) => self.wshard(key),
417 None => self.lock(),
418 };
419 if let Some(aof) = &mut g.aof {
420 let argv = Argv::from(parts.iter().map(|p| p.to_vec()).collect::<Vec<_>>());
421 aof.append(&argv)?;
422 }
423 Ok(())
424 }
425
426 // ---- maintenance ----------------------------------------------------
427
428 /// Run one TTL-reaper tick across every shard. Required call cadence in
429 /// `Manual` mode (~10×/s to match Redis `hz=10`). Returns the summed stats.
430 pub fn tick(&self) -> ExpireStats {
431 let mut total = ExpireStats::default();
432 for shard in self.shards.iter() {
433 let stats = {
434 let mut g = lock_write(shard);
435 g.store.tick_expire(self.config.reaper_samples, self.config.reaper_max_rounds)
436 };
437 total.sampled += stats.sampled;
438 total.expired += stats.expired;
439 // Auto-rewrite rides the caller-driven tick in Manual mode; the
440 // non-blocking path releases the lock for the disk spill.
441 crate::reaper::concurrent_auto_rewrite(
442 shard,
443 self.config.auto_aof_rewrite_pct,
444 self.config.auto_aof_rewrite_min_size,
445 self.config.metric_sink.as_ref(),
446 );
447 }
448 total
449 }
450
451 // Durability methods (`rewrite_aof`, `save_snapshot`) live in
452 // `crate::store_persist` to keep this file under the 500-LOC
453 // project ceiling.
454 // Data-type methods live in `crate::ops` / `crate::info`.
455
456 /// Crate-internal: clone shard 0's handle for a `Subscription`'s bus.
457 pub(crate) fn inner_handle(&self) -> Arc<RwLock<Inner>> {
458 self.shards[0].clone()
459 }
460
461 /// Crate-internal: clone the shared `Arc<DropGuard>`.
462 pub(crate) fn guard_handle(&self) -> Arc<DropGuard> {
463 self.guard.clone()
464 }
465
466 fn shard_for(&self, key: &[u8]) -> &Arc<RwLock<Inner>> {
467 &self.shards[shard_idx(key, self.shards.len())]
468 }
469
470 /// Write-lock the shard owning `key`.
471 pub(crate) fn wshard(&self, key: &[u8]) -> RwLockWriteGuard<'_, Inner> {
472 lock_write(self.shard_for(key))
473 }
474
475 /// Read-lock the shard owning `key` (GET fast path — concurrent readers
476 /// across shards run in parallel).
477 pub(crate) fn rshard(&self, key: &[u8]) -> RwLockReadGuard<'_, Inner> {
478 lock_read(self.shard_for(key))
479 }
480
481 /// Write-lock shard 0 — pub/sub bus + keyless escape hatches.
482 pub(crate) fn lock(&self) -> RwLockWriteGuard<'_, Inner> {
483 lock_write(&self.shards[0])
484 }
485
486 /// Run `f` over every shard's write guard, summing a `usize` (DBSIZE etc.).
487 pub(crate) fn sum_shards<F: Fn(&mut Inner) -> usize>(&self, f: F) -> usize {
488 self.shards.iter().map(|s| f(&mut lock_write(s))).sum()
489 }
490
491 /// Run `f` over every shard's write guard, summing a `u64`.
492 pub(crate) fn sum_shards_u64<F: Fn(&mut Inner) -> u64>(&self, f: F) -> u64 {
493 self.shards.iter().map(|s| f(&mut lock_write(s))).sum()
494 }
495
496 /// Run a fallible `f` over every shard (mutating, e.g. FLUSHALL).
497 pub(crate) fn try_for_each_shard<F: FnMut(&mut Inner) -> io::Result<()>>(
498 &self,
499 mut f: F,
500 ) -> io::Result<()> {
501 for s in self.shards.iter() {
502 f(&mut lock_write(s))?;
503 }
504 Ok(())
505 }
506}
507
508
509pub(crate) use crate::store_glue::{commit_write, lock_read, lock_write, store_err};
510
511impl Drop for DropGuard {
512 fn drop(&mut self) {
513 // Stop the replica runner FIRST so no more frames arrive while
514 // we're shutting down + flushing the AOF (frames would race
515 // with the shutdown path).
516 #[cfg(not(target_arch = "wasm32"))]
517 if let Some(r) = &self.replica_runner {
518 r.shutdown();
519 }
520 // Stop the writer-source accept + connection threads next, so
521 // no new replica picks up bytes mid-flush.
522 #[cfg(not(target_arch = "wasm32"))]
523 if let Some(rs) = &self.replica_source {
524 rs.shutdown();
525 }
526 // Stop + join the reaper, then flush every shard's AOF so EverySec
527 // users don't lose the last sub-second of writes.
528 if let Some(stop) = &self.reaper_stop {
529 stop.store(true, Ordering::Relaxed);
530 }
531 if let Some(j) = self
532 .reaper_join
533 .lock()
534 .unwrap_or_else(std::sync::PoisonError::into_inner)
535 .take()
536 {
537 let _ = j.join();
538 }
539 for shard in self.shards_for_flush.iter() {
540 let mut g = lock_write(shard);
541 if let Some(aof) = &mut g.aof {
542 let _ = aof.maybe_sync();
543 }
544 }
545 // v2.3: with the AOF durable, record the feed continuity
546 // marker — the cursor now exactly describes on-disk state.
547 #[cfg(not(target_arch = "wasm32"))]
548 if let Some((feed, dir)) = &self.feed_close {
549 Store::feed_write_close_marker(feed, dir);
550 }
551 }
552}
553
554
555#[cfg(test)]
556#[path = "store_tests.rs"]
557mod tests;
558#[cfg(test)]
559#[path = "store_tests_shard.rs"]
560mod tests_shard;
561#[cfg(test)]
562#[path = "store_tests_p2.rs"]
563mod tests_p2;
564#[cfg(test)]
565#[path = "store_tests_p3.rs"]
566mod tests_p3;
567#[cfg(test)]
568#[path = "store_tests_bitmap.rs"]
569mod tests_bitmap;
570#[cfg(test)]
571#[path = "store_tests_bonus.rs"]
572mod tests_bonus;
573#[cfg(test)]
574#[path = "store_tests_scan.rs"]
575mod tests_scan;
576#[cfg(test)]
577#[path = "store_tests_atomic.rs"]
578mod tests_atomic;
579#[cfg(test)]
580#[path = "store_tests_more.rs"]
581mod tests_more;
582#[cfg(test)]
583#[path = "store_tests_keyspace.rs"]
584mod tests_keyspace;
585#[cfg(test)]
586#[path = "store_tests_atomic_all.rs"]
587mod tests_atomic_all;
588#[cfg(test)]
589#[path = "store_tests_replay_all.rs"]
590mod tests_replay_all;
591#[cfg(test)]
592#[path = "store_tests_op_table.rs"]
593mod tests_op_table;