https://slatedb.io logo
I am looking at https://github.com/slatedb/slatedb...
# general
v
I am looking at https://github.com/slatedb/slatedb/issues/153 now. We decided to use attributes for storing Writer epoch and compactor epoch in the manifest doc, https://github.com/slatedb/slatedb/blob/main/rfcs/0001-manifest.md When I look at it now, I don't see an obvious benefit in storing it in attribute, vs storing it in SsTableInfo, inside the SST. Storing it inside SsTableInfo would likely flow better. We also don't use attributes for anything else today. @Rohan , @criccomini , do you remember other benefits of storing it in attribute?
f
+1 for storing these metadata inside SSTs or manifests. the datalakes like iceberg also rarely stores matadata in the object storage's attributes but prefer storing them in their own manifests files.
v
Will start it sometime tomorrow. And will see if there are additional points on this before starting.
c
TBH I don’t recall why we said attribute..
I can’t think of a reason why including it in the flat buffer would cause a problem
Maybe it was to make it easier to read?
If a write fails due to CAS, the failed write client would need to read the SST (or manifest?) to get the writer epoch
To see if it’s been fenced or if it should retry
🤔
v
Yes, this read can be done by head if it is in the attributes. If it is in the file content, it would require two reads. This is only during startup.
Such a fence is now done with manifest read, I am trying to remove that and read wal epoch instead.
c
WDYM by “this is only during startup”? Isn’t the writer epoch checked on a failed CAS write to the WAL?
(Which can happen at any point)
v
Conflict on regular write should exit. It must be the case that there is another writer. During startup, there could be two writers trying to open and they could both write manifest. Wal write success resolves the conflict.
c
But other writers could be older right?
Zombie
Oh wait.. the fencing write would prevent that
Gotcha
Ok so yea.. do we even need a writer epoch in the SST? On CAS fail, the writer could read the latest manifest to check the epoch right?
Since this is happening on startup, the manifest read shouldn’t be too costly…
v
https://github.com/slatedb/slatedb/pull/143#discussion_r1730273625 It is not costly, it was discussed in above comment. Idea was that we already have the wal, and the part of code that deals with this wouldn't need manifest for anything else, other than this.
r
I cant remember why but I thought we needed the metadata for some other reason, so if its there might as well use it. I agree for wal fencing might as well just use the manifest