criccomini
02/21/2025, 7:43 PMalmog
02/25/2025, 3:50 AMalmog
03/03/2025, 5:13 PMcriccomini
03/03/2025, 5:31 PMalmog
03/03/2025, 7:14 PMSyncLevel on the writer side, I don't understand ReadWatermark on the reader side. I left a comment on the RFC to that effect.
I might just be dense, if everyone else gets it then feel free to move on without me.criccomini
03/03/2025, 7:15 PMcriccomini
03/03/2025, 7:16 PMcriccomini
03/03/2025, 7:16 PMalmog
03/03/2025, 7:16 PMcriccomini
03/03/2025, 7:18 PMalmog
03/03/2025, 7:18 PMcriccomini
03/03/2025, 7:20 PMcriccomini
03/03/2025, 7:20 PMalmog
03/03/2025, 7:21 PMalmog
03/03/2025, 7:22 PMDurabilityLevel::Memory for all my reads, but if all writers write with SyncLevel::Remote i'll never see data until it's remote anywayalmog
03/03/2025, 7:22 PMReadWatermark?criccomini
03/03/2025, 7:24 PMcriccomini
03/03/2025, 7:26 PMalmog
03/03/2025, 7:30 PMSyncLevel::Remote) so at a minimum wouldn't I need to make that distinction if I wanted to sepcify "read dirty, but only if its persisted to local disk" (as opposed to, read dirty even if its only in memory)criccomini
03/03/2025, 7:31 PMcriccomini
03/03/2025, 7:31 PMcriccomini
03/03/2025, 7:31 PMcriccomini
03/03/2025, 7:32 PMcriccomini
03/03/2025, 7:32 PMalmog
03/03/2025, 7:32 PMcriccomini
03/03/2025, 7:32 PMcriccomini
03/04/2025, 4:24 PMalmog
03/04/2025, 4:25 PMflaneur233
03/05/2025, 6:44 AMflaneur233
03/05/2025, 6:44 AMDurabilityLevel, the mindset will be "read data persisted to Memory," "read data ensured to be persisted to Local," "read data ensured to be Remote." in my understanding, "read data persisted to Memory" doesn't directly imply the meaning of "latest committed"; it requires a mental deduction process.. therefore, I choose the api to be more contextual in the rfc, to specify we are reading at "the last committed point".
the semantic interpretation of DurabilityLevel::Memory in the read operations is actually the main concern for me... it could be interpereted as "persistence to memory", but "persistence to memory" this sentence is kinda paradox i am afraid, it's intention is more likely to be "no durability requirement"...
if we could remove DurabilityLevel::Memory, I think it would help reduce my confusion on this aspect, like:
enum DurabilityLevel {
Local,
Remote
}
struct GetOptions {
min_durability: Option<DurabilityLevel> // "min_durability" is suggested by claude sonnet 3.7 ๐, for it "
makes it clearer that you're specifying the minimum durability level required for the data you're reading"
}
db.get("key", GetOptions::new()::with_min_durability(DurabilityLevel::Remote))
if with_min_durability is not specified, it means no min durability about the data is required, we simply read the latest committed data.
@almog @criccomini how do you feel about this api?almog
03/05/2025, 2:31 PMalmog
03/05/2025, 2:37 PMRohan
03/06/2025, 12:36 AMflaneur233
03/06/2025, 3:10 AMcriccomini
03/06/2025, 3:23 AMcriccomini
03/06/2025, 3:26 AMflaneur233
03/06/2025, 3:28 AMRohan
03/06/2025, 5:58 AMRohan
03/06/2025, 6:02 AMRohan
03/06/2025, 6:03 AMflaneur233
03/06/2025, 6:22 AMflaneur233
03/06/2025, 6:23 AMflaneur233
03/06/2025, 6:25 AMflaneur233
03/06/2025, 6:29 AMflaneur233
03/06/2025, 6:33 AMflaneur233
03/06/2025, 6:34 AMwith_wait_durability besides with_sync ? if i remember correctly, the intention of having with_wait_durable besides with_sync is also to reduce the chance of being blocked by any other having sync commit ๐คRohan
03/06/2025, 10:18 PMLastCommitting its not requiredflaneur233
03/07/2025, 4:17 AMcriccomini
03/07/2025, 5:11 AMflaneur233
03/07/2025, 6:14 AMcriccomini
03/07/2025, 6:16 AMcriccomini
03/07/2025, 6:22 PMflaneur233
03/08/2025, 2:41 AMwith_sync and with_await_durable are write side apis (I'd hope to find a more concise API design though.. i found rocksdb also has a no-WAL mode while have way to watch the event of write got persisted with a WriteWithCallback api, maybe worth as an reference for this.. ). however, to move this RFC forward, I guess it might good to return to the approach of minimizing api changes and only adding capabilities.criccomini
03/09/2025, 4:57 PMalmog
03/09/2025, 7:44 PMalmog
03/09/2025, 7:45 PMcriccomini
03/09/2025, 8:20 PMcriccomini
03/09/2025, 8:21 PMcriccomini
03/09/2025, 8:21 PMflaneur233
03/10/2025, 2:49 AMLastCommitting as @Rohan suggested might conflict with the previous discussion with @almog about removing it, any suggestion about this? ๐ฅนflaneur233
03/10/2025, 2:51 AMRohan
03/10/2025, 5:50 AMLastComitting, he's just saying (and I agree) that it should be a separate config property with its own enum from the durability level since from the user's POV it's expressing two distinct guarantees. We'd almost certainly implement it by taking the two properties and mapping them to some watermark in the log, but theat's an implementation detail.Rohan
03/10/2025, 5:50 AMflaneur233
03/10/2025, 6:09 AMRohan
03/10/2025, 6:29 AMpub enum ReadLevel {
#[default]
Committed,
Committing,
}
pub enum Durability {
None,
Local,
Remote
}
struct ReadOptions {
read_level: ReadLevel,
durability: Durability
}
Then the read implementation just picks a watermark that satisfies both requirements. So if a user asks for read_level: Committing, durability: Remote it uses the sequence number that corresponds to the latest state persisted remotely. If a user asks for read_level: Committed, durability: None it uses the sequence number that corresponds to the latest committed write.Rohan
03/10/2025, 6:30 AMflaneur233
03/10/2025, 6:34 AMflaneur233
03/10/2025, 6:38 AMRohan
03/10/2025, 6:45 AMflaneur233
03/10/2025, 6:49 AMread side is still very confusing to me. I've tried to Google similar practices about setting Durability on read() but nothing found. i don't think there's anything called "Durability Gurantee" on the read side, the durability gurantee is guranteed at how fsync() is handled on the write, or how many replica have replicated in the write. readers just read established data, the readers can have an option choose flash back to specified point as a snapshot. i think having Durability Guarantee in read is what troubles me most so far.flaneur233
03/10/2025, 7:04 AMRohan
03/10/2025, 7:08 AMRohan
03/10/2025, 7:12 AMflaneur233
03/10/2025, 7:16 AMRohan
03/10/2025, 7:19 AMflaneur233
03/10/2025, 7:22 AMRohan
03/10/2025, 7:23 AMflaneur233
03/10/2025, 7:28 AMReadLevel::{LastCommitting, LastCommitted, LastLocalPersisted, LastRemotePersisted} to describe what's the position we hope to read is a way to skip the naming issue.. I am also afraid that these the two aspects aren't completely combinational - {Committing, Local} and {Committing, Remote} aren't particularly semantically coherent combinations, at least they should be treated as {Comitted, Local} and {Committed, Remote} underlying.. it also worries me a lot about how should we tell user when to use {Committing, Local} in the docs...almog
03/10/2025, 4:14 PM{Committing, Local} does make sense to me if the writer writes with SyncLevel::Remote - it's saying "I'm OK reading data that is "uncomitted" because it's not in remote yet so long as its persisted locally". It's scenarios like this which make me think tying the API to the implementation is likely going to bite us going forward.
I agree that {Committing, Remote} is a bit goofy, you may as well specify just Remote -- I don't think that's a problem because the user is "allowed" to think in terms of what matter to them: either the durability or the "consistency" guarantees.
Since we're sturggling to come up with a solution here I'm wondering if it makes sense to go back to the motivation. Is there really a need to support SyncLevel::Remote? It seems like if you have that kind of consistency guarantees SlateDB is not the right fit for you (probably the same with ReadDurability::Remote)flaneur233
03/11/2025, 1:59 AMflaneur233
03/11/2025, 2:04 AMalmog
03/11/2025, 6:27 PMcriccomini
03/11/2025, 10:43 PMcriccomini
03/11/2025, 10:44 PMcriccomini
03/11/2025, 10:53 PMcriccomini
03/11/2025, 10:53 PMalmog
03/11/2025, 11:00 PM{Committing, Local} means without making assumptions on how it's used. We could achieve the same behavior by saying "we recommend you set SyncLevel::Local and then read with LastCommitting if you want that behavior, but also make sure that you are OK reading data that isn't in Local if some writers decide to write with `SyncLevel::Memory`". That seems... more difficult to explainRohan
03/11/2025, 11:59 PMcriccomini
03/12/2025, 12:52 AMcriccomini
03/12/2025, 12:52 AMcriccomini
03/12/2025, 12:53 AMcriccomini
03/12/2025, 12:55 AMcriccomini
03/12/2025, 12:56 AMcriccomini
03/12/2025, 12:58 AMcriccomini
03/12/2025, 1:01 AMcriccomini
03/12/2025, 1:04 AMcriccomini
03/12/2025, 1:05 AMflaneur233
03/12/2025, 1:24 AMsync: local in your write, your write will be considered as committed when it's flushed into local disk & applied to memtable, you do not require to await it to be persisted in remote to be considered as "committed".flaneur233
03/12/2025, 1:27 AMRohan
03/12/2025, 1:35 AMflaneur233
03/12/2025, 1:38 AMflaneur233
03/12/2025, 1:43 AMflaneur233
03/12/2025, 1:48 AMsync_commit: remote, the commit simply aborted and nothing happens.criccomini
03/12/2025, 1:48 AMcriccomini
03/12/2025, 1:57 AMcriccomini
03/12/2025, 2:00 AMcriccomini
03/12/2025, 2:06 AMcriccomini
03/12/2025, 2:08 AMcriccomini
03/12/2025, 2:12 AMflaneur233
03/12/2025, 2:13 AMCommitting + Remote in the optionscriccomini
03/12/2025, 2:14 AMflaneur233
03/12/2025, 2:14 AMCommitting + Local seems trick for meflaneur233
03/12/2025, 2:18 AMalmog
03/12/2025, 2:18 AMalmog
03/12/2025, 2:18 AMflaneur233
03/12/2025, 2:22 AMcriccomini
03/12/2025, 2:23 AMcriccomini
03/12/2025, 2:25 AMcriccomini
03/12/2025, 2:28 AMcriccomini
03/12/2025, 2:31 AMflaneur233
03/12/2025, 2:35 AMwith_persisted_only(DurabiltyLevel{ Local, Remote}) or with_durable_only
- with_dirty(true / false) -> use a bool to avoid naming an enum, we all agree that LastCommitting is not a good default for normal users, it's an dangerous option, the data is risky to be lost after crash.
with_dirty() and with_persisted_only(DurabiltyLevel{ Local, Remote}) can not used together.
@almog @criccomini how do you feel about this api?
i found what we want is to specify a filter when it comes with durability on read side, it's not about durabilty gurantee.flaneur233
03/12/2025, 3:05 AMLocal requires us to read the data have to be persisted in Local. so what we have to do might be to read the WAL on local disk in stead of the in memory WAL, or have some water marks in the in memory WAL to allow us only read the wal entries that had local persisted, and do we need to skip memtable here? a memtable might partially persisted in localcriccomini
03/12/2025, 3:25 AMflaneur233
03/12/2025, 3:25 AMcriccomini
03/12/2025, 3:25 AMcriccomini
03/12/2025, 3:27 AMflaneur233
03/12/2025, 3:29 AMcriccomini
03/12/2025, 3:29 AMcriccomini
03/12/2025, 3:30 AMcriccomini
03/12/2025, 3:31 AMwith_durability and with_dirty?flaneur233
03/12/2025, 3:33 AM_only suffix may help empahsis it's a filter instead of a guarantee, 'durability' describes a property, while 'durable_only' refers to a filter.criccomini
03/12/2025, 3:33 AMcriccomini
03/12/2025, 3:33 AMcriccomini
03/12/2025, 3:33 AMflaneur233
03/12/2025, 3:34 AMwith_dirty is an advanced option, user should know what they are doing to use thisflaneur233
03/12/2025, 3:35 AMlocal + committing aside at the moment, just return error on this combinationcriccomini
03/12/2025, 3:36 AMcriccomini
03/12/2025, 3:36 AMcriccomini
03/12/2025, 3:37 AMwith_durability_filter? ๐flaneur233
03/12/2025, 3:38 AMcriccomini
03/12/2025, 3:38 AMcriccomini
03/12/2025, 3:39 AMwith_durability_filter that determines whether readers see local/remote committed data.
2. with_dirty, which determines if users see "committing" data (not yet durably written to the WAL as defined by the SyncLevel on the write-side).
3. Only one or the other can be set.criccomini
03/12/2025, 3:40 AMflaneur233
03/12/2025, 3:40 AMcriccomini
03/12/2025, 3:40 AMcriccomini
03/12/2025, 3:41 AMcriccomini
03/12/2025, 3:41 AMcriccomini
03/12/2025, 3:42 AMflaneur233
03/12/2025, 3:42 AMcriccomini
03/12/2025, 3:42 AMcriccomini
03/12/2025, 3:43 AMcriccomini
03/12/2025, 3:44 AMflaneur233
03/12/2025, 3:44 AMflaneur233
03/12/2025, 3:45 AMcriccomini
03/12/2025, 3:45 AMcriccomini
03/12/2025, 3:46 AMflaneur233
03/12/2025, 3:50 AMflaneur233
03/12/2025, 3:51 AMcriccomini
03/12/2025, 3:52 AMcriccomini
03/12/2025, 3:53 AMflaneur233
03/12/2025, 3:54 AMcriccomini
03/12/2025, 3:55 AMcriccomini
03/12/2025, 3:55 AMflaneur233
03/12/2025, 3:55 AMwith_dirty will resolve @Rohan 's requirement hereflaneur233
03/12/2025, 3:56 AMcriccomini
03/12/2025, 3:56 AMcriccomini
03/12/2025, 3:56 AMflaneur233
03/12/2025, 3:57 AMcriccomini
03/12/2025, 3:57 AMcriccomini
03/12/2025, 3:57 AMcriccomini
03/12/2025, 3:58 AMflaneur233
03/12/2025, 3:58 AMRohan
03/12/2025, 6:11 AMRohan
03/12/2025, 6:15 AMflaneur233
03/12/2025, 6:19 AMsync: Remote so it's considered as Committing not Committed, which seq <= we'd depends on for this?flaneur233
03/12/2025, 6:21 AMRohan
03/12/2025, 6:26 AMRohan
03/12/2025, 6:27 AMRohan
03/12/2025, 6:27 AMflaneur233
03/12/2025, 6:27 AMRohan
03/12/2025, 6:28 AMflaneur233
03/12/2025, 6:29 AMRohan
03/12/2025, 6:30 AMflaneur233
03/12/2025, 6:33 AMRohan
03/12/2025, 6:34 AMflaneur233
03/12/2025, 6:36 AMflaneur233
03/12/2025, 6:37 AMflaneur233
03/12/2025, 6:37 AMflaneur233
03/12/2025, 6:38 AMRohan
03/12/2025, 6:38 AMflaneur233
03/12/2025, 6:40 AMflaneur233
03/12/2025, 6:40 AMRohan
03/12/2025, 6:41 AMflaneur233
03/12/2025, 6:44 AMflaneur233
03/12/2025, 6:45 AMalmog
03/12/2025, 2:31 PMcriccomini
03/12/2025, 11:34 PMcriccomini
03/13/2025, 12:13 AMcriccomini
03/13/2025, 12:13 AMcriccomini
03/13/2025, 12:13 AMcriccomini
03/13/2025, 12:13 AMalmog
03/13/2025, 2:52 AMflaneur233
03/13/2025, 3:45 AMsync: Off on the write operation, this write operation may still be blocked by the previous write with sync: Remote, so, it'll append the write to the in memory WAL buffer, and not visible to readers which hope to only read the committed data. at this moment, the readers with dirty: true can read these writes.criccomini
03/13/2025, 4:13 AMcriccomini
03/13/2025, 4:16 AMflaneur233
03/13/2025, 6:34 AMput(sync off) will still await the previous commit to be persisted to Remote, because all the commits are ordered, even it's sync=off , commit() call will still await the commit to be applied, so the next read() will keep "read-your-write consistency" ๐ฅนflaneur233
03/13/2025, 6:50 AMRohan
03/13/2025, 8:25 AMawait_durable is true, when it's durable).flaneur233
03/13/2025, 8:29 AMRohan
03/13/2025, 8:35 AMflaneur233
03/13/2025, 8:35 AMfsync() the wal. after a successful commit(), the subsequent reads will read its previous writes.flaneur233
03/13/2025, 8:38 AMflaneur233
03/13/2025, 8:40 AMRohan
03/13/2025, 8:40 AMflaneur233
03/13/2025, 8:40 AMsync: off does not means it's an async write.flaneur233
03/13/2025, 8:42 AMcommit() ensures the next reads operations have a "read your writes"flaneur233
03/13/2025, 8:43 AMflaneur233
03/13/2025, 8:44 AMcommit() semantic.flaneur233
03/13/2025, 8:45 AMcommit() always implies "apply the write".Rohan
03/13/2025, 8:48 AMcommit):
// returns err if it fails ssi check
accepted_txn = txn.apply(sync: <whatever>).await?;
// waits for the commit to finish
accepted_txn.await_commit().await;
> i am afraid of it might have some unknown risks to have some behavior not aligned with rocksdb or other systems on the commit() semantic.
I'm starting to feel like all the dbs are subtly different anyway. So someone who's already familiar with how they work will know to carefully try to understand what the semantics are in slatedb. And someone who isn't familiar will need to do that anyway.flaneur233
03/13/2025, 8:49 AMRohan
03/13/2025, 8:49 AMflaneur233
03/13/2025, 8:49 AMsync: true/false on write operations, and every write operation have an "async" counterpartyRohan
03/13/2025, 8:50 AMRohan
03/13/2025, 8:51 AMflaneur233
03/13/2025, 8:52 AMflaneur233
03/13/2025, 8:54 AMWriteOptions a lot: https://pkg.go.dev/github.com/cockroachdb/pebble#WriteOptionsflaneur233
03/13/2025, 8:57 AMflaneur233
03/13/2025, 9:18 AMCommitWith(cb func(err error)) function to allow users have a no-await commit call.criccomini
03/13/2025, 5:57 PMcriccomini
03/13/2025, 7:10 PMcriccomini
03/13/2025, 7:10 PM