Skip to content

Instantly share code, notes, and snippets.

View zhangsoledad's full-sized avatar
🏠
Working from home

zhangsoledad zhangsoledad

🏠
Working from home
View GitHub Profile
  1. tikv gc TiDB 的事务的实现采用了 MVCC(多版本并发控制)机制,当新写入的数据覆盖旧的数据时,旧的数据不会被替换掉,而是与新写入的数据同时保留,并以时间戳来区分版本。GC 的任务便是清理不再需要的旧数据。 https://pingcap.com/docs-cn/stable/reference/garbage-collection/overview/#gc-%25E6%259C%25BA%25E5%2588%25B6%25E7%25AE%2580%25E4%25BB%258B https://github.com/tikv/tikv/tree/master/src/server/gc_worker

  2. delete-range

  • The most common pattern we see is scan-and-delete, i.e., advance an iterator through the to-be-deleted range, and issue a Delete for each key. This is slow (involves read I/O) so cannot be done in any critical path. Additionally, it creates many tombstones, which slows down iterators and doesn’t offer a deadline for space reclamation.
  • Deleting a range of keys is a common pattern in RocksDB. Most systems built on top of RocksDB have multi-component key schemas, where keys sharing a common prefix are logically related
  • DeleteFilesInRange can be used prior to compacting the deleted range as long as snapshot readers do not need to access them. It drops files that are completely conta
name = "ckb"
[genesis]
version = 0
parent_hash = "0x0000000000000000000000000000000000000000000000000000000000000000"
timestamp = 1573179873372
compact_target = 0x1a107feb
uncles_hash = "0x0000000000000000000000000000000000000000000000000000000000000000"
nonce = "0x0"
This file has been truncated, but you can view the full file.
cursor 12 block 1 reward 191780821918 miner 70a9c852cbec1e5d3b497c7d51e9501acf88f01c
cursor 13 block 2 reward 191780821918 miner 70a9c852cbec1e5d3b497c7d51e9501acf88f01c
cursor 14 block 3 reward 191780821918 miner 70a9c852cbec1e5d3b497c7d51e9501acf88f01c
cursor 15 block 4 reward 191780821918 miner 70a9c852cbec1e5d3b497c7d51e9501acf88f01c
cursor 16 block 5 reward 191780821918 miner 70a9c852cbec1e5d3b497c7d51e9501acf88f01c
cursor 17 block 6 reward 191780821918 miner 70a9c852cbec1e5d3b497c7d51e9501acf88f01c
cursor 18 block 7 reward 191780821918 miner 70a9c852cbec1e5d3b497c7d51e9501acf88f01c
cursor 19 block 8 reward 191780821918 miner 70a9c852cbec1e5d3b497c7d51e9501acf88f01c
cursor 20 block 9 reward 191780821918 miner 70a9c852cbec1e5d3b497c7d51e9501acf88f01c
cursor 21 block 10 reward 191780821918 miner 70a9c852cbec1e5d3b497c7d51e9501acf88f01c
This file has been truncated, but you can view the full file.
cursor 12 block 1 reward 191780821918 miner 70a9c852cbec1e5d3b497c7d51e9501acf88f01c
cursor 13 block 2 reward 191780821918 miner 70a9c852cbec1e5d3b497c7d51e9501acf88f01c
cursor 14 block 3 reward 191780821918 miner 70a9c852cbec1e5d3b497c7d51e9501acf88f01c
cursor 15 block 4 reward 191780821918 miner 70a9c852cbec1e5d3b497c7d51e9501acf88f01c
cursor 16 block 5 reward 191780821918 miner 70a9c852cbec1e5d3b497c7d51e9501acf88f01c
cursor 17 block 6 reward 191780821918 miner 70a9c852cbec1e5d3b497c7d51e9501acf88f01c
cursor 18 block 7 reward 191780821918 miner 70a9c852cbec1e5d3b497c7d51e9501acf88f01c
cursor 19 block 8 reward 191780821918 miner 70a9c852cbec1e5d3b497c7d51e9501acf88f01c
cursor 20 block 9 reward 191780821918 miner 70a9c852cbec1e5d3b497c7d51e9501acf88f01c
cursor 21 block 10 reward 191780821918 miner 70a9c852cbec1e5d3b497c7d51e9501acf88f01c
lock 0xdde7801c073dfb3464c7b1f05b806bb2bbb84e99 minning 2557409977765047 capacity 750120900000000
lock 0x9bb3c7b40e6277e2bcd6dcbef2dc87c83492310d minning 208307153445218 capacity 61099100000000
lock 0x0a486fb8f6fe60f76f001d6372da41be91172259 minning 659136238614247 capacity 193333000000000
lock 0x322f0a74c932f0b0beb47ab10b94ab2c8049bb88 minning 113681577901 capacity 33300000000
lock 0x70a9c852cbec1e5d3b497c7d51e9501acf88f01c minning 39320157231931 capacity 11533100000000
lock 0xed99d08d751ae32df7fc6f3048b7cca56c3bfafa minning 626906534797 capacity 183800000000
lock 0x53a7e7d5b1b059ac8e13ae1c284e9252c8b1047d minning 1156553341248 capacity 339200000000
lock 0xddc1ddf9c135061b7635ca51e735fc2b03cee339 minning 227761824126934 capacity 66805400000000
lock 0x2ec3a5fb4098b14f4887555fe58d966cab2c6a63 minning 1545439294676200 capacity 453297000000000
lock 0xf48b5f8d51de5a81614545f7580b0569fd80bb77 minning 399543378996 capacity 117100000000
lock b"p\xa9\xc8R\xcb\xec\x1e];I|}Q\xe9P\x1a\xcf\x88\xf0\x1c" capacity 39320157231931
lock b"\nHo\xb8\xf6\xfe`\xf7o\0\x1dcr\xdaA\xbe\x91\x17\"Y" capacity 659136238614247
lock b"2/\nt\xc92\xf0\xb0\xbe\xb4z\xb1\x0b\x94\xab,\x80I\xbb\x88" capacity 113681577901
lock b"\xf4\x8b_\x8dQ\xdeZ\x81aEE\xf7X\x0b\x05i\xfd\x80\xbbw" capacity 399543378996
lock b"S\xa7\xe7\xd5\xb1\xb0Y\xac\x8e\x13\xae\x1c(N\x92R\xc8\xb1\x04}" capacity 1156553341248
lock b"\xdd\xe7\x80\x1c\x07=\xfb4d\xc7\xb1\xf0[\x80k\xb2\xbb\xb8N\x99" capacity 2557409977765047
lock b"\x9b\xb3\xc7\xb4\x0ebw\xe2\xbc\xd6\xdc\xbe\xf2\xdc\x87\xc84\x921\r" capacity 208307153445218
lock b".\xc3\xa5\xfb@\x98\xb1OH\x87U_\xe5\x8d\x96l\xab,jc" capacity 1545439294676200
lock b"\xdd\xc1\xdd\xf9\xc15\x06\x1bv5\xcaQ\xe75\xfc+\x03\xce\xe39" capacity 227761824126934
lock b"\xac3\xe9\xcaie\xbe\xb1f M\x0ck\xf4'\xdc\xab;oK" capacity 793754522234192
Explorer endpoint 90785
cursor 1011 block 1000 reward 106544901066
cursor 1012 block 1001 reward 106544901066
cursor 1013 block 1002 reward 106544901066
cursor 1014 block 1003 reward 106544901066
cursor 1015 block 1004 reward 106544901066
cursor 1016 block 1005 reward 106544901066
cursor 1017 block 1006 reward 106544901066
cursor 1018 block 1007 reward 106544901066
cursor 1019 block 1008 reward 106544901066
lock 0x95018bd6afc9302125ae893d6c414c6e83bf5744 106544901066/17260082191780802
lock 0x0c808125e3b96ddc742fe7c3a62ed639ff9763d9 1122239143592/17260082191780802
lock 0xa13ccf4e84f865d56100f32cec382922b301c4ce 265624407088/17260082191780802
lock 0xac33e9ca6965beb166204d0c6bf427dcab3b6f4b 3032032508999706/17260082191780802
lock 0x53a7e7d5b1b059ac8e13ae1c284e9252c8b1047d 97849095455241/17260082191780802
lock 0xed99d08d751ae32df7fc6f3048b7cca56c3bfafa 3063485810613/17260082191780802
lock 0x0a486fb8f6fe60f76f001d6372da41be91172259 688503362535524/17260082191780802
lock 0x9bb3c7b40e6277e2bcd6dcbef2dc87c83492310d 3383865935843832/17260082191780802
lock 0x70a9c852cbec1e5d3b497c7d51e9501acf88f01c 754486337538/17260082191780802
lock 0xddc1ddf9c135061b7635ca51e735fc2b03cee339 2670092232794778/17260082191780802
@zhangsoledad
zhangsoledad / writeup.md
Created October 25, 2019 07:31 — forked from edmundsmith/writeup.md
Method for Emulating Higher-Kinded Types in Rust

Method for Emulating Higher-Kinded Types in Rust

Intro

I've been fiddling about with an idea lately, looking at how higher-kinded types can be represented in such a way that we can reason with them in Rust here and now, without having to wait a couple years for what would be a significant change to the language and compiler.

There have been multiple discussions on introducing higher-ranked polymorphism into Rust, using Haskell-style Higher-Kinded Types (HKTs) or Scala-looking Generalised Associated Types (GATs). The benefit of higher-ranked polymorphism is to allow higher-level, richer abstractions and pattern expression than just the rank-1 polymorphism we have today.

As an example, currently we can express this type:

@zhangsoledad
zhangsoledad / bechmark.md
Last active December 29, 2018 10:12
numext vs ethtypes