Skip to content

Commit

Permalink
Fix incorrect comments
Browse files Browse the repository at this point in the history
  • Loading branch information
umegane committed Jan 22, 2025
1 parent 61432b8 commit 2192348
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/limestone/cursor_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ bool cursor_impl::is_relevant_entry(const limestone::api::log_entry& entry) {
// Step 5: Retrieve the write_version from clear_storage_ for the same storage ID
write_version_type range_ver = it->second;

// Step 6: Compare the versions (only if the entry is normal_entry or remove_entry)
// Step 6: Compare the versions
if (wv < range_ver) {
return false; // Skip this entry as it is outdated
}
Expand Down
7 changes: 7 additions & 0 deletions src/limestone/parse_wal_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ void invalidate_epoch_snippet(boost::filesystem::fstream& strm, std::streampos f
// log_entries = log_entry log_entries
// | (empty)
// log_entry = normal_entry
// | normal_with_blob
// | remove_entry
// | clear_storage
// | add_storage
Expand All @@ -75,11 +76,13 @@ void invalidate_epoch_snippet(boost::filesystem::fstream& strm, std::streampos f
// log_entries = log_entry log_entries
// | (empty)
// log_entry = normal_entry { if (valid) process-entry }
// | normal_with_blob { if (valid) process-entry }
// | remove_entry { if (valid) process-entry }
// | clear_storage { if (valid) process-entry }
// | add_storage { if (valid) process-entry }
// | remove_storage { if (valid) process-entry }
// | SHORT_normal_entry { if (valid) error-truncated } // TAIL
// | SHORT_normal_with_blob { if (valid) error-truncated } // TAIL
// | SHORT_remove_entry { if (valid) error-truncated } // TAIL
// | SHORT_clear_storage { if (valid) error-truncated } // TAIL
// | SHORT_add_storage { if (valid) error-truncated } // TAIL
Expand All @@ -91,6 +94,7 @@ void invalidate_epoch_snippet(boost::filesystem::fstream& strm, std::streampos f
// marker_begin = 0x02 epoch
// marker_invalidated_begin = 0x06 epoch
// normal_entry = 0x01 key_length value_length storage_id key(key_length) write_version_major write_version_minor value(value_length)
// normal_with_blog = 0x0a key_length value_length storage_id key(key_length) write_version_major write_version_minor value(value_length) FIXME
// remove_entry = 0x05 key_length storage_id key(key_length) writer_version_major writer_version_minor
// marker_durable = 0x04 epoch
// marker_end = 0x03 epoch
Expand All @@ -109,6 +113,7 @@ void invalidate_epoch_snippet(boost::filesystem::fstream& strm, std::streampos f
// | 0x01 key_length value_length storage_id key(key_length) byte(0-15)
// | 0x01 key_length value_length storage_id key(<key_length)
// | 0x01 byte(0-15)
// SHORT_normal_with_blob = 0x0a key_length value_length storage_id key(key_length) write_version_major write_version_minor value(<value_length) FIXME
// SHORT_remove_entry = 0x05 key_length storage_id key(key_length) byte(0-15)
// | 0x05 key_length storage_id key(<key_length)
// | 0x05 byte(0-11)
Expand Down Expand Up @@ -189,6 +194,7 @@ void invalidate_epoch_snippet(boost::filesystem::fstream& strm, std::streampos f
// else : { err_unexpected } -> END
// loop:
// normal_entry : { if (valid) process-entry } -> loop
// normal_with_blob : { if (valid) process-entry } -> loop
// remove_entry : { if (valid) process-entry } -> loop
// clear_storage : { if (valid) process-entry } -> loop
// add_storage : { if (valid) process-entry } -> loop
Expand All @@ -197,6 +203,7 @@ void invalidate_epoch_snippet(boost::filesystem::fstream& strm, std::streampos f
// marker_begin : { head_pos := ...; max-epoch := max(...); if (epoch <= ld) { valid := true } else { valid := false, error-nondurable } } -> loop
// marker_invalidated_begin : { head_pos := ...; max-epoch := max(...); valid := false } -> loop
// SHORT_normal_entry : { if (valid) error-truncated } -> END
// SHORT_normal_with_blob : { if (valid) error-truncated } -> END
// SHORT_remove_entry : { if (valid) error-truncated } -> END
// SHORT_clear_storage : { if (valid) error-truncated } -> END
// SHORT_add_storage : { if (valid) error-truncated } -> END
Expand Down

0 comments on commit 2192348

Please sign in to comment.