Skip to content

Commit

Permalink
Set segments counter to 1 after empty log recovery
Browse files Browse the repository at this point in the history
  • Loading branch information
kjnilsson committed Aug 20, 2024
1 parent 320f5c9 commit 81f087b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/osiris_log.erl
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,7 @@ init(#{dir := Dir,
{ok, SegFd} = open(Filename, ?FILE_OPTS_WRITE),
{ok, IdxFd} = open(IdxFilename, ?FILE_OPTS_WRITE),
{ok, _} = file:position(SegFd, ?LOG_HEADER_SIZE),
counters:put(Cnt, ?C_SEGMENTS, 1),
%% the segment could potentially have trailing data here so we'll
%% do a truncate just in case. The index would have been truncated
%% earlier
Expand Down

0 comments on commit 81f087b

Please sign in to comment.