armink / FlashDB

An ultra-lightweight database that supports key-value and time series data | 一款支持 KV 数据和时序数据的超轻量级数据库
Apache License 2.0
1.83k stars 420 forks source link

kvdb写满后,写入同名键值对无法写入无法覆盖,且kv大小是扇区的一半时,空间利用率最差,只有一半,fdb_kv_print打印的kv也不全但是get能读到 #306

Open YanChao001 opened 1 month ago

YanChao001 commented 1 month ago

letter:/$ file -l

test1=blob @0x00000019 1024bytes test2=blob @0x00000819 1024bytes test3=blob @0x00001019 1024bytes test4=blob @0x00001819 1024bytes test5=blob @0x00002019 1024bytes test6=blob @0x00002819 1024bytes test7=blob @0x00003019 1024bytes test8=blob @0x00003819 1024bytes test9=blob @0x00004019 1024bytes test10=blob @0x0000481A 1024bytes test11=blob @0x0000501A 1024bytes test12=blob @0x0000581A 1024bytes test13=blob @0x0000601A 1024bytes test14=blob @0x0000681A 1024bytes test15=blob @0x0000701A 1024bytes test16=blob @0x0000781A 1024bytes test17=blob @0x0000801A 1024bytes test18=blob @0x0000881A 1024bytes test19=blob @0x0000901A 1024bytes test20=blob @0x0000981A 1024bytes test21=blob @0x0000A01A 1024bytes test22=blob @0x0000A81A 1024bytes test23=blob @0x0000B01A 1024bytes

mode: next generation size: 24141/47104 bytes. letter:/$ file -w test1

[FlashDB][kv][user][kvdb_user] (../Code/ThirdParty/FlashDB/src/fdb_kvdb.c:928) Trigger a GC check after alloc KV failed. [FlashDB][kv][user][kvdb_user] Warning: Alloc an KV (size 1041) failed when new KV. Now will GC then retry. [FlashDB][kv][user][kvdb_user] (../Code/ThirdParty/FlashDB/src/fdb_kvdb.c:1149) The remain empty sector is 1, GC threshold is 1. [FlashDB][kv][user][kvdb_user] (../Code/ThirdParty/FlashDB/src/fdb_kvdb.c:928) Trigger a GC check after alloc KV failed. [FlashDB][kv][user][kvdb_user] Error: Alloc an KV (size 0) failed after GC. KV full. letter:/$

armink commented 1 month ago

这个 KV 格式是 blob 类型,并不是可以支持打印的 string 字符串,所以不会显示的,只会显示大小