@feltdb/core 0.6.9 → 0.6.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/commands.js +189 -71
- package/dist/cli/index.js +1 -1
- package/dist/collection.d.ts +110 -2
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +228 -3
- package/dist/create/package-versions.js +1 -1
- package/dist/create/server-source/crates/feltdb/src/bin/feltdb_node.rs +408 -178
- package/dist/create/server-source/crates/feltdb/src/lib.rs +49 -5
- package/dist/create/server-source/crates/feltdb/src/multi_operation_transaction.rs +659 -0
- package/dist/create/server-source/crates/feltdb/src/p1_application_atomicity.rs +285 -0
- package/dist/create/server-source/crates/feltdb/src/p1_atomicity_acceptance.rs +582 -0
- package/dist/create/server-source/crates/feltdb-server/src/main.rs +141 -0
- package/dist/db.d.ts +59 -0
- package/dist/db.d.ts.map +1 -1
- package/dist/db.js +94 -2
- package/dist/embedded-transaction.d.ts +77 -0
- package/dist/embedded-transaction.d.ts.map +1 -0
- package/dist/embedded-transaction.js +102 -0
- package/dist/feltdb.d.ts +49 -1
- package/dist/feltdb.d.ts.map +1 -1
- package/dist/file-db.d.ts +33 -0
- package/dist/file-db.d.ts.map +1 -1
- package/dist/file-db.js +128 -4
- package/dist/freshness.d.ts +119 -0
- package/dist/freshness.d.ts.map +1 -0
- package/dist/freshness.js +115 -0
- package/dist/http-db.d.ts +48 -0
- package/dist/http-db.d.ts.map +1 -1
- package/dist/http-db.js +77 -1
- package/dist/index-backend.d.ts +8 -0
- package/dist/index-backend.d.ts.map +1 -1
- package/dist/index-backend.js +13 -0
- package/dist/index-core.d.ts +78 -0
- package/dist/index-core.d.ts.map +1 -0
- package/dist/index-core.js +72 -0
- package/dist/index-manager.d.ts +11 -0
- package/dist/index-manager.d.ts.map +1 -1
- package/dist/index-manager.js +30 -13
- package/dist/index-types.d.ts +17 -0
- package/dist/index-types.d.ts.map +1 -1
- package/dist/index.browser.d.ts +14 -0
- package/dist/index.browser.d.ts.map +1 -0
- package/dist/index.browser.js +13 -0
- package/dist/index.d.ts +8 -59
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -54
- package/dist/indexeddb-db.d.ts +32 -0
- package/dist/indexeddb-db.d.ts.map +1 -1
- package/dist/indexeddb-db.js +151 -1
- package/dist/memory-db.d.ts +26 -0
- package/dist/memory-db.d.ts.map +1 -1
- package/dist/memory-db.js +86 -0
- package/dist/runtime-registry.d.ts +32 -0
- package/dist/runtime-registry.d.ts.map +1 -0
- package/dist/runtime-registry.js +38 -0
- package/dist/studio-app/assets/{feltdb_wasm-B4wq4mqp.js → feltdb_wasm-CJv3wHzi.js} +1 -1
- package/dist/studio-app/assets/feltdb_wasm_bg-C8TG8r2n.wasm +0 -0
- package/dist/studio-app/assets/index-D3rT0SJi.js +28 -0
- package/dist/studio-app/index.html +1 -1
- package/dist/transaction.d.ts +98 -0
- package/dist/transaction.d.ts.map +1 -0
- package/dist/transaction.js +86 -0
- package/dist/wasm/feltdb_wasm_bg.wasm +0 -0
- package/dist/workspace/browser.d.ts +22 -0
- package/dist/workspace/browser.d.ts.map +1 -0
- package/dist/workspace/browser.js +17 -0
- package/dist/workspace/git-identity.d.ts +35 -0
- package/dist/workspace/git-identity.d.ts.map +1 -0
- package/dist/workspace/git-identity.js +81 -0
- package/dist/workspace/index.d.ts +11 -1
- package/dist/workspace/index.d.ts.map +1 -1
- package/dist/workspace/index.js +6 -0
- package/dist/workspace/investigation-analysis.d.ts +47 -0
- package/dist/workspace/investigation-analysis.d.ts.map +1 -0
- package/dist/workspace/investigation-analysis.js +181 -0
- package/dist/workspace/investigation-lifecycle-manager.d.ts +86 -0
- package/dist/workspace/investigation-lifecycle-manager.d.ts.map +1 -0
- package/dist/workspace/investigation-lifecycle-manager.js +229 -0
- package/dist/workspace/investigation-supervisor.d.ts +100 -0
- package/dist/workspace/investigation-supervisor.d.ts.map +1 -0
- package/dist/workspace/investigation-supervisor.js +236 -0
- package/dist/workspace/runtime-investigation.d.ts +1 -1
- package/dist/workspace/runtime-investigation.d.ts.map +1 -1
- package/dist/workspace/runtime-investigation.js +46 -21
- package/dist/workspace/runtime-observation.d.ts +79 -0
- package/dist/workspace/runtime-observation.d.ts.map +1 -0
- package/dist/workspace/runtime-observation.js +152 -0
- package/dist/workspace/runtime-observer.d.ts +51 -0
- package/dist/workspace/runtime-observer.d.ts.map +1 -0
- package/dist/workspace/runtime-observer.js +268 -0
- package/dist/workspace/workspace-connection.d.ts.map +1 -1
- package/dist/workspace/workspace-connection.js +14 -5
- package/dist/workspace/workspace-types.d.ts +113 -0
- package/dist/workspace/workspace-types.d.ts.map +1 -1
- package/package.json +12 -4
- package/dist/create/server-source/crates/feltdb/src/phase_1c_three_node.rs +0 -523
- package/dist/studio-app/assets/feltdb_wasm_bg-Ceyi7l21.wasm +0 -0
- package/dist/studio-app/assets/index-BF45M757.js +0 -28
|
@@ -40,6 +40,9 @@ pub mod in_process_transport;
|
|
|
40
40
|
pub mod tcp_transport;
|
|
41
41
|
pub mod operation_algebra;
|
|
42
42
|
pub mod crash_atomic_boundary;
|
|
43
|
+
pub mod multi_operation_transaction;
|
|
44
|
+
pub mod p1_atomicity_acceptance;
|
|
45
|
+
pub mod p1_application_atomicity;
|
|
43
46
|
pub mod causal_dependency_barrier;
|
|
44
47
|
pub mod partition_reconciliation;
|
|
45
48
|
pub mod consistency_contract;
|
|
@@ -63,7 +66,6 @@ mod phase1c_atomicity_proof;
|
|
|
63
66
|
#[cfg(test)]
|
|
64
67
|
mod phase1c3_acceptance;
|
|
65
68
|
#[cfg(test)]
|
|
66
|
-
mod phase_1c_three_node;
|
|
67
69
|
#[cfg(test)]
|
|
68
70
|
mod phase_1c_real_tcp;
|
|
69
71
|
#[cfg(test)]
|
|
@@ -2140,13 +2142,55 @@ where
|
|
|
2140
2142
|
}
|
|
2141
2143
|
}
|
|
2142
2144
|
|
|
2145
|
+
/// Read the log, separating a torn tail from real corruption.
|
|
2146
|
+
///
|
|
2147
|
+
/// A process that dies while appending leaves a final record that was never
|
|
2148
|
+
/// terminated. That record was never committed, so recovery discards it and
|
|
2149
|
+
/// truncates it away: leaving the bytes in place would make the next append
|
|
2150
|
+
/// splice onto them and turn a normal crash into permanent corruption.
|
|
2151
|
+
///
|
|
2152
|
+
/// Damage anywhere earlier is not an interrupted write. Recovery refuses it
|
|
2153
|
+
/// rather than silently dropping committed history.
|
|
2154
|
+
fn read_log_lines(path: &Path) -> Result<Vec<String>> {
|
|
2155
|
+
let mut file = BufReader::new(OpenOptions::new().read(true).open(path)?);
|
|
2156
|
+
let mut lines: Vec<(String, bool)> = Vec::new();
|
|
2157
|
+
let mut buffer = Vec::new();
|
|
2158
|
+
loop {
|
|
2159
|
+
buffer.clear();
|
|
2160
|
+
if file.read_until(b'\n', &mut buffer)? == 0 {
|
|
2161
|
+
break;
|
|
2162
|
+
}
|
|
2163
|
+
let terminated = buffer.ends_with(b"\n");
|
|
2164
|
+
let text = String::from_utf8_lossy(&buffer)
|
|
2165
|
+
.trim_end_matches('\n')
|
|
2166
|
+
.to_string();
|
|
2167
|
+
lines.push((text, terminated));
|
|
2168
|
+
}
|
|
2169
|
+
|
|
2170
|
+
let mut torn_bytes = 0usize;
|
|
2171
|
+
if let Some((text, terminated)) = lines.last() {
|
|
2172
|
+
let unusable = !*terminated || serde_json::from_str::<Value>(text).is_err();
|
|
2173
|
+
if unusable && !text.trim().is_empty() {
|
|
2174
|
+
torn_bytes = text.len() + usize::from(*terminated);
|
|
2175
|
+
lines.pop();
|
|
2176
|
+
}
|
|
2177
|
+
}
|
|
2178
|
+
|
|
2179
|
+
if torn_bytes > 0 {
|
|
2180
|
+
let file = OpenOptions::new().write(true).open(path)?;
|
|
2181
|
+
let length = file.metadata()?.len();
|
|
2182
|
+
file.set_len(length.saturating_sub(torn_bytes as u64))?;
|
|
2183
|
+
file.sync_all()?;
|
|
2184
|
+
}
|
|
2185
|
+
|
|
2186
|
+
Ok(lines.into_iter().map(|(text, _)| text).collect())
|
|
2187
|
+
}
|
|
2188
|
+
|
|
2143
2189
|
fn replay_log(inner: &mut Inner) -> Result<()> {
|
|
2144
|
-
let
|
|
2145
|
-
let reader = BufReader::new(file);
|
|
2190
|
+
let lines = read_log_lines(&inner.path)?;
|
|
2146
2191
|
|
|
2147
2192
|
let mut snapshot_log = false;
|
|
2148
|
-
for line in
|
|
2149
|
-
let line = line?;
|
|
2193
|
+
for line in lines {
|
|
2150
2194
|
if line.trim().is_empty() {
|
|
2151
2195
|
continue;
|
|
2152
2196
|
}
|