Releases: guycipher/k4
Releases · guycipher/k4
K4 v2.1.8
K4 v2.1.8 PATCH BREAKING
- We replaced gob with a custom encoding an decoding implementation for KeyValue and Operation structures. We did this as gob was causing very large file sizes and using lots of memory. These new methods should assist in these issues.
encodeKV
,decodeKV
,encodeOp
,decodeOp
are the new methods, replacing previousserializeKv
,deserializeKv
,serializeOp
,deserializeOp
. In v2.1.6 and v2.1.7 it was found on flush of memtables to disk a 90mb memtable could resolve to almost 1gb.
K4 v2.1.7
K4 v2.1.7 PATCH BREAKING
As discussed here #25
- Corrected memtable size incrementation
- Modified pager to use less space changing page body size to 1024 and header size to 16. Thus every page now takes 1040 bytes as opposed to 4156.
Thank you @marvin-j97 for the issue reporting and testing you concluded. Good stuff.
K4 v2.1.6
K4 v2.1.5
K4 v2.1.4
K4 v2.1.3
K4 v2.1.2
K4 v1.9.7
K4 v1.9.6
K4 v1.9.6 PATCH
- Update to pager which is used for WAL, and SSTables to periodically sync to disk.
New pager constants
const SYNC_TICK_INTERVAL = 1 * time.Second // tick interval for syncing the file
const SYNC_ESCALATION = 1 * time.Minute // if the file is not synced in 1 minute, sync it
const WRITE_THRESHOLD = 24576 // every 24576 writes, sync the file
New periodic sync method
func (p *Pager) startPeriodicSync() {
defer p.wg.Done()
p.once.Do(func() {
ticker := time.NewTicker(SYNC_TICK_INTERVAL)
defer ticker.Stop()
for {
select {
case <-ticker.C:
if p.writeCounter < WRITE_THRESHOLD {
if time.Since(p.lastSync) < SYNC_ESCALATION { // check if the file is synced in SYNC_ESCALATION
continue
} // if the file is not synced in SYNC_ESCALATION, sync it
}
err := p.file.Sync()
if err != nil {
return
}
p.lock.Lock()
p.writeCounter = 0
p.lastSync = time.Now()
p.lock.Unlock()
case <-p.stopSync:
return
}
}
})
}