Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

infine loop when put a kv pair bigger than writebuffer #309

Closed
zojw opened this issue Nov 22, 2022 · 2 comments · Fixed by #324
Closed

infine loop when put a kv pair bigger than writebuffer #309

zojw opened this issue Nov 22, 2022 · 2 comments · Fixed by #324
Assignees

Comments

@zojw
Copy link
Contributor

zojw commented Nov 22, 2022

    #[photonio::test]
    async fn crud() {
        env_logger::init();

        const OPTIONS: TableOptions = TableOptions {
            page_size: 64,
            page_chain_length: 2,
            page_store: PageStoreOptions {
                write_buffer_capacity: 1 << 10,
                max_write_buffers: 8,
                use_direct_io: false,
                max_space_amplification_percent: 10,
                space_used_high: u64::MAX,
            },
        };

        let path = tempdir().unwrap();
        let table = Table::open(&path, OPTIONS).await.unwrap();

        let buf = 1u8.to_be_bytes().repeat(2048);
        table.put(&buf, 0, &buf).await.unwrap();

        table.close().await.unwrap();
    }

It will infine loop and output log like

[2022-11-22T04:05:27Z INFO  photondb::page_store::write_buffer] Seal write buffer 2636, allocated 0 bytes, usage 0.0000
[2022-11-22T04:05:27Z INFO  photondb::page_store::buffer_set] Stalling writes because we have 8 sealed write buffers (wait for flush)
[2022-11-22T04:05:27Z INFO  photondb::page_store::page_file::file_builder] finish flush file: 2629
[2022-11-22T04:05:27Z INFO  photondb::page_store::jobs::flush] Flush output file 2629 with 56 bytes, 0 active pages, 0 dealloc pages, lasted 5355 microseconds
[2022-11-22T04:05:27Z INFO  photondb::page_store::jobs::flush] Flush write buffer 2630 to page file, num_records: 0 num_tombstone_records: 0 num_dealloc_pages: 0 num_skip_pages: 0 data_size: 0
[2022-11-22T04:05:27Z INFO  photondb::page_store::write_buffer] Seal write buffer 2637, allocated 0 bytes, usage 0.0000
[2022-11-22T04:05:27Z INFO  photondb::page_store::buffer_set] Stalling writes because we have 8 sealed write buffers (wait for flush)
[2022-11-22T04:05:27Z INFO  photondb::page_store::page_file::file_builder] finish flush file: 2630
[2022-11-22T04:05:27Z INFO  photondb::page_store::jobs::flush] Flush output file 2630 with 56 bytes, 0 active pages, 0 dealloc pages, lasted 5402 microseconds
[2022-11-22T04:05:27Z INFO  photondb::page_store::jobs::flush] Flush write buffer 2631 to page file, num_records: 0 num_tombstone_records: 0 num_dealloc_pages: 0 num_skip_pages: 0 data_size: 0
[2022-11-22T04:05:27Z INFO  photondb::page_store::write_buffer] Seal write buffer 2638, allocated 0 bytes, usage 0.0000
[2022-11-22T04:05:27Z INFO  photondb::page_store::buffer_set] Stalling writes because we have 8 sealed write buffers (wait for flush)
[2022-11-22T04:05:27Z INFO  photondb::page_store::page_file::file_builder] finish flush file: 2631
[2022-11-22T04:40:53Z INFO  photondb::page_store::jobs::flush] Flush output file 2631 with 56 bytes, 0 active pages, 0 dealloc pages, lasted 2126118146 microseconds
[2022-11-22T04:40:53Z INFO  photondb::page_store::jobs::flush] Flush write buffer 2632 to page file, num_records: 0 num_tombstone_records: 0 num_dealloc_pages: 0 num_skip_pages: 0 data_size: 0
[2022-11-22T04:42:35Z INFO  photondb::page_store::page_file::file_builder] finish flush file: 2632
[2022-11-22T04:42:35Z INFO  photondb::page_store::write_buffer] Seal write buffer 2639, allocated 0 bytes, usage 0.0000
[2022-11-22T04:42:35Z INFO  photondb::page_store::buffer_set] Stalling writes because we have 8 sealed write buffers (wait for flush)
[2022-11-22T04:42:35Z INFO  photondb::page_store::jobs::flush] Flush output file 2632 with 56 bytes, 0 active pages, 0 dealloc pages, lasted 102241569 microseconds
[2022-11-22T04:42:35Z INFO  photondb::page_store::jobs::flush] Flush write buffer 2633 to page file, num_records: 0 num_tombstone_records: 0 num_dealloc_pages: 0 num_skip_pages: 0 data_size: 0
[2022-11-22T04:42:47Z INFO  photondb::page_store::write_buffer] Seal write buffer 2640, allocated 0 bytes, usage 0.0000
[2022-11-22T04:42:47Z INFO  photondb::page_store::buffer_set] Stalling writes because we have 8 sealed write buffers (wait for flush)
[2022-11-22T04:42:47Z INFO  photondb::page_store::page_file::file_builder] finish flush file: 2633
[2022-11-22T04:42:47Z INFO  photondb::page_store::jobs::flush] Flush output file 2633 with 56 bytes, 0 active pages, 0 dealloc pages, lasted 11698799 microseconds
[2022-11-22T04:42:47Z INFO  photondb::page_store::jobs::flush] Flush write buffer 2634 to page file, num_records: 0 num_tombstone_records: 0 num_dealloc_pages: 0 num_skip_pages: 0 data_size: 0
[2022-11-22T04:42:48Z INFO  photondb::page_store::write_buffer] Seal write buffer 2641, allocated 0 bytes, usage 0.0000
[2022-11-22T04:42:48Z INFO  photondb::page_store::buffer_set] Stalling writes because we have 8 sealed write buffers (wait for flush)
[2022-11-22T04:42:48Z INFO  photondb::page_store::page_file::file_builder] finish flush file: 2634
[2022-11-22T04:42:48Z INFO  photondb::page_store::jobs::flush] Flush output file 2634 with 56 bytes, 0 active pages, 0 dealloc pages, lasted 898807 microseconds
[2022-11-22T04:42:48Z INFO  photondb::page_store::jobs::flush] Flush write buffer 2635 to page file, num_records: 0 num_tombstone_records: 0 num_dealloc_pages: 0 num_skip_pages: 0 data_size: 0
[2022-11-22T04:42:49Z INFO  photondb::page_store::write_buffer] Seal write buffer 2642, allocated 0 bytes, usage 0.0000
[2022-11-22T04:42:49Z INFO  photondb::page_store::buffer_set] Stalling writes because we have 8 sealed write buffers (wait for flush)
[2022-11-22T04:42:49Z INFO  photondb::page_store::page_file::file_builder] finish flush file: 2635
[2022-11-22T04:42:49Z INFO  photondb::page_store::jobs::flush] Flush output file 2635 with 56 bytes, 0 active pages, 0 dealloc pages, lasted 835919 microseconds
[2022-11-22T04:42:49Z INFO  photondb::page_store::jobs::flush] Flush write buffer 2636 to page file, num_records: 0 num_tombstone_records: 0 num_dealloc_pages: 0 num_skip_pages: 0 data_size: 0
[2022-11-22T04:42:50Z INFO  photondb::page_store::write_buffer] Seal write buffer 2643, allocated 0 bytes, usage 0.0000
[2022-11-22T04:42:50Z INFO  photondb::page_store::buffer_set] Stalling writes because we have 8 sealed write buffers (wait for flush)
[2022-11-22T04:42:50Z INFO  photondb::page_store::page_file::file_builder] finish flush file: 2636
[2022-11-22T04:42:50Z INFO  photondb::page_store::jobs::flush] Flush output file 2636 with 56 bytes, 0 active pages, 0 dealloc pages, lasted 850552 microseconds
[2022-11-22T04:42:50Z INFO  photondb::page_store::jobs::flush] Flush write buffer 2637 to page file, num_records: 0 num_tombstone_records: 0 num_dealloc_pages: 0 num_skip_pages: 0 data_size: 0
[2022-11-22T04:42:51Z INFO  photondb::page_store::write_buffer] Seal write buffer 2644, allocated 0 bytes, usage 0.0000
[2022-11-22T04:42:51Z INFO  photondb::page_store::buffer_set] Stalling writes because we have 8 sealed write buffers (wait for flush)
[2022-11-22T04:42:51Z INFO  photondb::page_store::page_file::file_builder] finish flush file: 2637
[2022-11-22T04:42:51Z INFO  photondb::page_store::jobs::flush] Flush output file 2637 with 56 bytes, 0 active pages, 0 dealloc pages, lasted 1130855 microseconds
[2022-11-22T04:42:51Z INFO  photondb::page_store::jobs::flush] Flush write buffer 2638 to page file, num_records: 0 num_tombstone_records: 0 num_dealloc_pages: 0 num_skip_pages: 0 data_size: 0
[2022-11-22T04:43:09Z INFO  photondb::page_store::write_buffer] Seal write buffer 2645, allocated 0 bytes, usage 0.0000
[2022-11-22T04:43:09Z INFO  photondb::page_store::buffer_set] Stalling writes because we have 8 sealed write buffers (wait for flush)
[2022-11-22T04:43:09Z INFO  photondb::page_store::page_file::file_builder] finish flush file: 2638
[2022-11-22T04:43:09Z INFO  photondb::page_store::jobs::flush] Flush output file 2638 with 56 bytes, 0 active pages, 0 dealloc pages, lasted 17724840 microseconds
[2022-11-22T04:43:09Z INFO  photondb::page_store::jobs::flush] Flush write buffer 2639 to page file, num_records: 0 num_tombstone_records: 0 num_dealloc_pages: 0 num_skip_pages: 0 data_size: 0
[2022-11-22T04:43:11Z INFO  photondb::page_store::write_buffer] Seal write buffer 2646, allocated 0 bytes, usage 0.0000
[2022-11-22T04:43:11Z INFO  photondb::page_store::buffer_set] Stalling writes because we have 8 sealed write buffers (wait for flush)
[2022-11-22T04:43:11Z INFO  photondb::page_store::page_file::file_builder] finish flush file: 2639
[2022-11-22T04:43:11Z INFO  photondb::page_store::jobs::flush] Flush output file 2639 with 56 bytes, 0 active pages, 0 dealloc pages, lasted 2502016 microseconds
[2022-11-22T04:43:11Z INFO  photondb::page_store::jobs::flush] Flush write buffer 2640 to page file, num_records: 0 num_tombstone_records: 0 num_dealloc_pages: 0 num_skip_pages: 0 data_size: 0
[2022-11-22T04:43:27Z INFO  photondb::page_store::page_file::file_builder] finish flush file: 2640
[2022-11-22T04:43:29Z INFO  photondb::page_store::jobs::flush] Flush output file 2640 with 56 bytes, 0 active pages, 0 dealloc pages, lasted 18111455 microseconds
[2022-11-22T04:43:32Z INFO  photondb::page_store::write_buffer] Seal write buffer 2647, allocated 0 bytes, usage 0.0000
[2022-11-22T04:43:32Z INFO  photondb::page_store::buffer_set] Stalling writes because we have 8 sealed write buffers (wait for flush)
[2022-11-22T04:43:38Z INFO  photondb::page_store::jobs::flush] Flush write buffer 2641 to page file, num_records: 0 num_tombstone_records: 0 num_dealloc_pages: 0 num_skip_pages: 0 data_size: 0
[2022-11-22T04:43:41Z INFO  photondb::page_store::page_file::file_builder] finish flush file: 2641
@w41ter
Copy link
Contributor

w41ter commented Nov 22, 2022

I think we should add a kv size check, too large should return an error: TooLargeSize

@zojw
Copy link
Contributor Author

zojw commented Nov 22, 2022

I think we should add a kv size check, too large should return an error: TooLargeSize

+1, let me add it when free~

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants