Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ has to be enabled, either by setting the flag in
executable using `--flag=+serialblockio`.

> :warning: **When enabling `serialblockio`, disable the
> `cabal.project.blockio-uring` import in `cabal.project`!** Unforunately, this
> `cabal.project.blockio-uring` import in `cabal.project`!** Unfortunately, this
> line has to be removed/commented out manually (for now), or the project won't
> build.

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ It has support for:

- Monoidal upserts which combine the stored and new values.

- BLOB storage which assocates a large auxiliary BLOB with a key.
- BLOB storage which associates a large auxiliary BLOB with a key.

- Durable on-disk persistence and rollback via named snapshots.

Expand Down Expand Up @@ -78,7 +78,7 @@ LSM-trees can be used concurrently, but with a few restrictions:
cannot be accessed from different processes at the same time.

- Tables can be used concurrently and concurrent use of read operations
such as lookups is determinstic. However, concurrent use of write
such as lookups is deterministic. However, concurrent use of write
operations such as insert or delete with any other operation results
in a race condition.

Expand Down Expand Up @@ -318,7 +318,7 @@ The worst-case in-memory size of an LSM-tree is *O*(*n*).
A compact index stores the 64 most significant bits of the minimum
serialised key for each memory page, as well as 1 bit per memory page
to resolve clashes, 1 bit per memory page to mark overflow pages, and
a negligable amount of memory for tie breakers. The total in-memory
a negligible amount of memory for tie breakers. The total in-memory
size of all indexes is approximately 66 bits per memory page.

The total size of an LSM-tree must not exceed 2<sup>41</sup> physical
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ constructIndexCompact (ChunkSize csize) apps = runST $ do
Benchmarks for UTxO keys that are /almost/ uniformly distributed
-------------------------------------------------------------------------------}

-- | UTXO keys are not truly uniformly distrbuted. The 'txId' is a uniformly
-- | UTXO keys are not truly uniformly distributed. The 'txId' is a uniformly
-- distributed hash, but the same 'txId' can appear in multiple UTXO keys, but
-- with a different 'txIx'. In the worst case, this means that we have a clash
-- in the compact index for /every page/. The following benchmarks show
Expand Down
2 changes: 1 addition & 1 deletion blockio/src-sim/System/FS/BlockIO/Sim.hs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ fromHasFS hfs =
-- | Lock files are reader\/writer locks.
--
-- We implement this using the content of the lock file. The content is a
-- counter, positive for readers and negaive (specifically -1) for writers.
-- counter, positive for readers and negative (specifically -1) for writers.
-- There can be any number of readers, but only one writer. Writers can not
-- coexist with readers.
--
Expand Down
4 changes: 2 additions & 2 deletions blockio/src/System/FS/BlockIO/API.hs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ data HasBlockIO m h = HasBlockIO {
-- function in 'IO' much more complex. In particular, if we want to reuse
-- "GHC.IO.Handle.Lock" functionality, then we have to either ...
--
-- 1. Convert there and back between OS-specific file desciptors and
-- 1. Convert there and back between OS-specific file descriptors and
-- 'GHC.Handle's, which is not possible on Windows without creating new
-- file descriptors, or ...
-- 2. Vendor all of the "GHC.IO.Handle.Lock" code and its dependencies
Expand All @@ -131,7 +131,7 @@ data HasBlockIO m h = HasBlockIO {
-- | Synchronise file contents with the storage device.
--
-- Ensure that all change to the file handle's contents which exist only in
-- memory (as buffered system cache pages) are transfered/flushed to disk.
-- memory (as buffered system cache pages) are transferred/flushed to disk.
-- This will also update the file handle's associated metadata.
--
-- This uses different system calls on different distributions.
Expand Down
2 changes: 1 addition & 1 deletion bloomfilter/src/Data/BloomFilter/Hash.hs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ https://github.com/facebook/rocksdb/blob/096fb9b67d19a9a180e7c906b4a0cdb2b2d0c1f

-}

-- | Evalute 'CheapHashes' family.
-- | Evaluate 'CheapHashes' family.
--
-- \[
-- g_i = h_0 + \left\lfloor h_1 / 2^i \right\rfloor
Expand Down
2 changes: 1 addition & 1 deletion doc/format-page.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ representation gives natural alignment without any padding.

If the blob reference bitmap indicates that there is a blob reference for key i,
then the index in the blob reference array can be found by counting the number
of 1 bits for all bitmap indexes stricly less than i. This can be done
of 1 bits for all bitmap indexes strictly less than i. This can be done
relatively efficiently using the popcount CPU instruction. For example, pages
with up to 64 keys, the bitmap fits into a single 64bit word and thus a single
popcount instruction, (and some bit shifting and masking) is needed to find the
Expand Down
2 changes: 1 addition & 1 deletion doc/format-run.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ vector.

The first 4 bytes (32bit) are a format identifier / format version. This
determines the format of the rest of the header and file.
The format identifier also acts as endianess marker.
The format identifier also acts as endianness marker.
It (and remaining fields) are serialised in native byte order.

The remainder of the header for format 1 consists of:
Expand Down
6 changes: 3 additions & 3 deletions lsm-tree.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description:
* Basic key–value operations, such as lookup, insert, and delete.
* Range lookups, which efficiently retrieve the values for all keys in a given range.
* Monoidal upserts which combine the stored and new values.
* BLOB storage which assocates a large auxiliary BLOB with a key.
* BLOB storage which associates a large auxiliary BLOB with a key.
* Durable on-disk persistence and rollback via named snapshots.
* Cheap table duplication where all duplicates can be independently accessed and modified.
* High-performance lookups on SSDs using I\/O batching and parallelism.
Expand Down Expand Up @@ -47,7 +47,7 @@ description:

* Each session locks its session directory.
This means that a database cannot be accessed from different processes at the same time.
* Tables can be used concurrently and concurrent use of read operations such as lookups is determinstic.
* Tables can be used concurrently and concurrent use of read operations such as lookups is deterministic.
However, concurrent use of write operations such as insert or delete with any other operation results in a race condition.

== Performance #performance#
Expand Down Expand Up @@ -172,7 +172,7 @@ description:
An ordinary index stores the maximum serialised key for each memory page.
The total in-memory size of all indexes is proportional to the average size of one serialised key per memory page.
[@CompactIndex@]:
A compact index stores the 64 most significant bits of the minimum serialised key for each memory page, as well as 1 bit per memory page to resolve clashes, 1 bit per memory page to mark overflow pages, and a negligable amount of memory for tie breakers.
A compact index stores the 64 most significant bits of the minimum serialised key for each memory page, as well as 1 bit per memory page to resolve clashes, 1 bit per memory page to mark overflow pages, and a negligible amount of memory for tie breakers.
The total in-memory size of all indexes is approximately 66 bits per memory page.

The total size of an LSM-tree must not exceed \(2^{41}\) physical entries.
Expand Down
2 changes: 1 addition & 1 deletion prototypes/ScheduledMerges.hs
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ newMergingRun mergeType runs = do
assertST $ length runs > 1
-- in some cases, no merging is required at all
(debt, state) <- case filter (\r -> runSize r > 0) runs of
[] -> let (r:_) = runs -- just re-use the empty input
[] -> let (r:_) = runs -- just reuse the empty input
in return (runSize r, CompletedMerge r)
[r] -> return (runSize r, CompletedMerge r)
rs -> do
Expand Down
4 changes: 2 additions & 2 deletions src-control/Control/ActionRegistry.hs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ mapActionError f (ActionError e) = ActionError (f e)
--
-- If the code was interrupted due to an exception for example, then the
-- registry is aborted, which performs registered rollback actions. If the code
-- succesfully terminated, then the registry is committed, in which case
-- successfully terminated, then the registry is committed, in which case
-- registered, delayed actions will be performed.
--
-- Registered actions are run in LIFO order, whether they be rollback actions or
Expand Down Expand Up @@ -481,7 +481,7 @@ mapExceptionWithActionRegistry f action = action `catch` (throwIO . mapSomeExcep
Rollback actions and delayed actions are performed /precisely/ when aborting
or committing an action registry respectively (see [Action
registry](#g:actionRegistry)). To achieve this, finalisation of the action
registry happens in the same masked state as runnning the registered actions.
registry happens in the same masked state as running the registered actions.
This means all the usual masking caveats apply for the registered actions.
-}

Expand Down
4 changes: 2 additions & 2 deletions src-control/Control/RefCount.hs
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ data Enabled a = Enabled !a | Disabled
globalForgottenRef :: IORef (Enabled (Maybe (RefId, CallStack)))
globalForgottenRef = unsafePerformIO $ newIORef (Enabled Nothing)

-- | This version of 'unsafeIOToPrim' is strict in the result of the arument
-- | This version of 'unsafeIOToPrim' is strict in the result of the argument
-- action.
--
-- Without strictness it seems that some IO side effects are not happening at
Expand Down Expand Up @@ -580,7 +580,7 @@ checkForgottenRefs = do
_unused = throwIO @m @SomeException

-- | Ignore and reset the state of forgotten reference tracking. This ensures
-- that any stale fogotten references are not reported later.
-- that any stale forgotten references are not reported later.
--
-- This is especillay important in QC tests with shrinking which otherwise
-- leads to confusion.
Expand Down
2 changes: 1 addition & 1 deletion src-extras/Database/LSMTree/Extras/ReferenceImpl.hs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ instance Arbitrary PageContentOrdered where
shrink (PageContentOrdered kops) =
map PageContentOrdered (shrinkOrderedKeyOps kops)

-- | Stricly increasing, so no duplicates.
-- | Strictly increasing, so no duplicates.
pageContentOrderedInvariant :: PageContentOrdered -> Bool
pageContentOrderedInvariant (PageContentOrdered kops) =
pageContentFitsInvariant (PageContentFits kops)
Expand Down
2 changes: 1 addition & 1 deletion src-kmerge/KMerge/Heap.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
-- (internally the filling of root value and sifting down is delayed).
--
-- Also there isn't *insert* operation, i.e. the heap can only shrink.
-- Other heap usual heap opeartions are *create-heap*, *extract-min* and *replace*.
-- Other heap usual heap operations are *create-heap*, *extract-min* and *replace*.
-- However, as the 'MutableHeap' always represents a heap with its root (minimum value)
-- extracted, *extract-min* is "fused" to other operations.
module KMerge.Heap (
Expand Down
2 changes: 1 addition & 1 deletion src/Database/LSMTree/Internal/BlobRef.hs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ data StrongBlobRef m h = StrongBlobRef {
-- | Convert a 'RawBlobRef' to a 'WeakBlobRef'.
rawToWeakBlobRef :: RawBlobRef m h -> WeakBlobRef m h
rawToWeakBlobRef RawBlobRef {rawBlobRefFile, rawBlobRefSpan} =
-- This doesn't need to really do anything, becuase the raw version
-- This doesn't need to really do anything, because the raw version
-- does not maintain an independent ref count, and the weak one does
-- not either.
WeakBlobRef {
Expand Down
2 changes: 1 addition & 1 deletion src/Database/LSMTree/Internal/CRC32C.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE UnboxedTuples #-}

-- | Functionalty related to CRC-32C (Castagnoli) checksums:
-- | Functionality related to CRC-32C (Castagnoli) checksums:
--
-- * Support for calculating checksums while incrementally writing files.
-- * Support for verifying checksums of files.
Expand Down
2 changes: 1 addition & 1 deletion src/Database/LSMTree/Internal/Index/CompactAcc.hs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ new maxcsize = IndexCompactAcc
<*> newSTRef SNothing
<*> newSTRef SNothing

-- | We explictly pin the byte arrays, since that allows for more efficient
-- | We explicitly pin the byte arrays, since that allows for more efficient
-- serialisation, as the definition of 'isByteArrayPinned' changed in GHC 9.6,
-- see <https://gitlab.haskell.org/ghc/ghc/-/issues/22255>.
--
Expand Down
2 changes: 1 addition & 1 deletion src/Database/LSMTree/Internal/Lookup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ intraPageLookupsOn !resolveV !acc0 !rs !ks !rkixs !ioops !ioress =
V.unsafeInsertWithMStrict res (combine resolveV) kix e'
loop res (ioopix + 1)

-- Check that the IOOp was performed succesfully, and that it wrote/read
-- Check that the IOOp was performed successfully, and that it wrote/read
-- exactly as many bytes as we expected. If not, then the buffer won't
-- contain the correct number of disk-page bytes, so we throw an exception.
checkIOResult :: IOOp (PrimState m) h -> IOResult -> m ()
Expand Down
2 changes: 1 addition & 1 deletion src/Database/LSMTree/Internal/MergeSchedule.hs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ releaseTableContent reg (TableContent _wb wbb levels cache ul) = do
Levels cache
-------------------------------------------------------------------------------}

-- | Flattend cache of the runs that referenced by a table.
-- | Flattened cache of the runs that referenced by a table.
--
-- This cache includes a vector of runs, but also vectors of the runs broken
-- down into components, like bloom filters, fence pointer indexes and file
Expand Down
2 changes: 1 addition & 1 deletion src/Database/LSMTree/Internal/MergingRun.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1024,5 +1024,5 @@ expectCompleted (DeRef MergingRun {..}) = do
CompletedMerge r -> dupRef r -- return a fresh reference to the run
OngoingMerge{} -> do
-- If the algorithm finds an ongoing merge here, then it is a bug in
-- our merge sceduling algorithm. As such, we throw a pure error.
-- our merge scheduling algorithm. As such, we throw a pure error.
error "expectCompleted: expected a completed merge, but found an ongoing merge"
6 changes: 3 additions & 3 deletions src/Database/LSMTree/Internal/Paths.hs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ newtype SnapshotName = SnapshotName FilePath
instance Show SnapshotName where
showsPrec d (SnapshotName p) = showsPrec d p

-- | The given string must satsify 'isValidSnapshotName'.
-- | The given string must satisfy 'isValidSnapshotName'.
-- Otherwise, 'fromString' throws an 'InvalidSnapshotNameError'.
instance IsString SnapshotName where
fromString :: String -> SnapshotName
Expand Down Expand Up @@ -163,7 +163,7 @@ isValidSnapshotName str =

-- | Create snapshot name.
--
-- The given string must satsify 'isValidSnapshotName'.
-- The given string must satisfy 'isValidSnapshotName'.
--
-- Throws the following exceptions:
--
Expand Down Expand Up @@ -304,7 +304,7 @@ newtype ForIndex a = ForIndex {unForIndex :: a}
ForRunFiles abstraction
-------------------------------------------------------------------------------}

-- | Stores someting for each run file (except the checksums file), allowing to
-- | Stores something for each run file (except the checksums file), allowing to
-- easily do something for all of them without mixing them up.
data ForRunFiles a = ForRunFiles {
forRunKOps :: !(ForKOps a)
Expand Down
2 changes: 1 addition & 1 deletion src/Database/LSMTree/Internal/RunAcc.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS_HADDOCK not-home #-}

-- | Incremental (in-memory portion of) run consruction
-- | Incremental (in-memory portion of) run construction
--
module Database.LSMTree.Internal.RunAcc (
RunAcc (..)
Expand Down
2 changes: 1 addition & 1 deletion src/Database/LSMTree/Internal/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ resolveValidOutput (v1 :: v) (v2 :: v) =

{- |
Wrapper that provides an instance of 'ResolveValue' via the 'Semigroup'
instance of the underyling type.
instance of the underlying type.

prop> resolve (ResolveViaSemigroup v1) (ResolveViaSemigroup v2) = ResolveViaSemigroup (v1 <> v2)
-}
Expand Down
2 changes: 1 addition & 1 deletion src/Database/LSMTree/Internal/Unsafe.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1606,7 +1606,7 @@ tableContentToMergingTree seshEnv conf
-- any pre-existing union in the input table:
unionmt = case tableUnionLevel of
NoUnion -> Nothing
Union mt _ -> Just mt -- we could re-use the cache, but it
Union mt _ -> Just mt -- we could reuse the cache, but it
-- would complicate things
in newPendingLevelMerge runs unionmt
where
Expand Down
2 changes: 1 addition & 1 deletion src/Database/LSMTree/Simple.hs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ Just (Value "Hello")
--------------------------------------------------------------------------------

{- $resource_management
This package uses explicit resource mangagement. The 'Session', 'Table', and 'Cursor'
This package uses explicit resource management. The 'Session', 'Table', and 'Cursor'
handles hold open resources, such as file handles, which must be explicitly released.
Every operation that allocates a resource is paired with another operation to releases
that resource. For each pair of allocate and release operations there is a bracketed
Expand Down
2 changes: 1 addition & 1 deletion test/Database/LSMTree/Class/Common.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import System.FS.BlockIO.API (HasBlockIO)
-- | Constraints for keys, values, and blobs
type C k v b = (CK k, CV v, CB b)

-- | Constaints for keys
-- | Constraints for keys
type CK k = (C_ k, SerialiseKey k)

-- | Constraints for values
Expand Down
2 changes: 1 addition & 1 deletion test/Database/LSMTree/Model/Session.hs
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ listSnapshots ::
listSnapshots = gets (Map.keys . snapshots)

{-------------------------------------------------------------------------------
Mutiple writable tables
Multiple writable tables
-------------------------------------------------------------------------------}

duplicate ::
Expand Down
2 changes: 1 addition & 1 deletion test/Database/LSMTree/Model/Table.hs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ snapshot ::
snapshot = id

{-------------------------------------------------------------------------------
Mutiple writable tables
Multiple writable tables
-------------------------------------------------------------------------------}

duplicate ::
Expand Down
2 changes: 1 addition & 1 deletion test/Test/Database/LSMTree/Internal/CRC32C.hs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ prop_putGet (PartialIOErrors errs) bss =
let expected = CRC32C (Data.Digest.CRC32C.crc32c (BS.concat bss))
return (all (expected==) [crc1, crc2, crc3])

-- TODO: test like prop_putGet but with put curruption, to detect that the
-- TODO: test like prop_putGet but with put corruption, to detect that the
-- crc doesn't match, to detect the corruption.

prop_writeRead :: PartialIOErrors -> ChecksumsFile -> Bool
Expand Down
2 changes: 1 addition & 1 deletion test/Test/Database/LSMTree/Internal/Index/Compact.hs
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ multiPageValuesClash ic
-- triplet of contiguous LTP bits, and a C bit corresponding to the middle
-- of the triplet.
p (cj, ltpi, ltpj, ltpk) =
-- two multi-page values border eachother
-- two multi-page values border each other
unBit ltpi && not (unBit ltpj) && unBit ltpk
-- and they clash
&& unBit cj
Expand Down
2 changes: 1 addition & 1 deletion test/Test/Database/LSMTree/Internal/RunBuilder.hs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ runParams =
runParamIndex = Index.Ordinary
}

-- | 'new' in an existing directory should be succesfull.
-- | 'new' in an existing directory should be successful.
prop_newInExistingDir :: HasFS IO h -> FS.HasBlockIO IO h -> IO Property
prop_newInExistingDir hfs hbio = do
let runDir = FS.mkFsPath ["a", "b", "c"]
Expand Down
Loading