Skip to content

Commit

Permalink
test(journal): add logging for when backpressure happens
Browse files Browse the repository at this point in the history
  • Loading branch information
symbiont-stevan-andjelkovic committed Jan 19, 2022
1 parent c1f6dad commit 288026f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/journal/src/Journal/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ calculatePositionLimit jour = do
cleanBufferTo :: Journal -> Int -> IO ()
cleanBufferTo _ _ = return ()

backPressureStatus _ _ = return Nothing
backPressureStatus _ _ = do
putStrLn "backPressureStatus"
return Nothing

newPosition :: Metadata -> Maybe (TermOffset, BufferClaim) -> IO (Maybe (Int64, BufferClaim))
newPosition meta mResult =
Expand Down
4 changes: 2 additions & 2 deletions src/journal/src/Journal/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ activeTermCount (Metadata meta) =
TermCount <$> readInt32OffAddr meta lOG_ACTIVE_TERM_COUNT_OFFSET

writeActiveTermCount :: Metadata -> TermCount -> IO ()
writeActiveTermCount (Metadata meta) = do
writeIntOffAddr meta lOG_ACTIVE_TERM_COUNT_OFFSET . fromIntegral
writeActiveTermCount (Metadata meta) =
writeInt32OffAddr meta lOG_ACTIVE_TERM_COUNT_OFFSET . unTermCount

casActiveTermCount :: Metadata -> TermCount -> TermCount -> IO Bool
casActiveTermCount (Metadata meta) (TermCount expected) (TermCount new) =
Expand Down

0 comments on commit 288026f

Please sign in to comment.