|
1 | 1 | use std::fs::File; |
2 | 2 |
|
3 | 3 | use super::{ |
4 | | - arr_to_lsn, arr_to_u32, assert_usize, bump_atomic_lsn, decompress, header, |
5 | | - iobuf, lsn_to_arr, pread_exact, pread_exact_or_eof, roll_iobuf, u32_to_arr, |
6 | | - Arc, BasedBuf, DiskPtr, HeapId, IoBuf, IoBufs, LogKind, LogOffset, Lsn, |
| 4 | + arr_to_lsn, arr_to_u32, assert_usize, decompress, header, iobuf, |
| 5 | + lsn_to_arr, pread_exact, pread_exact_or_eof, roll_iobuf, u32_to_arr, Arc, |
| 6 | + BasedBuf, DiskPtr, HeapId, IoBuf, IoBufs, LogKind, LogOffset, Lsn, |
7 | 7 | MessageKind, Reservation, Serialize, Snapshot, BATCH_MANIFEST_PID, |
8 | 8 | COUNTER_PID, MAX_MSG_HEADER_LEN, META_PID, SEG_HEADER_LEN, |
9 | 9 | }; |
@@ -140,7 +140,7 @@ impl Log { |
140 | 140 | #[cfg(feature = "compression")] |
141 | 141 | { |
142 | 142 | if self.config.use_compression && pid != BATCH_MANIFEST_PID { |
143 | | - use zstd::block::compress; |
| 143 | + use zstd::bulk::compress; |
144 | 144 |
|
145 | 145 | let buf = item.serialize(); |
146 | 146 |
|
@@ -417,10 +417,9 @@ impl Log { |
417 | 417 | reservation_lid, |
418 | 418 | ); |
419 | 419 |
|
420 | | - bump_atomic_lsn( |
421 | | - &self.iobufs.max_reserved_lsn, |
422 | | - reservation_lsn + inline_buf_len as Lsn - 1, |
423 | | - ); |
| 420 | + self.iobufs |
| 421 | + .max_reserved_lsn |
| 422 | + .fetch_max(reservation_lsn + inline_buf_len as Lsn - 1, SeqCst); |
424 | 423 |
|
425 | 424 | let (heap_reservation, heap_id_opt) = if over_heap_threshold { |
426 | 425 | let heap_reservation = self |
|
0 commit comments