@nxtedition/rocksdb 6.0.2 → 6.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (257) hide show
  1. package/BUILDING.md +12 -4
  2. package/binding.cc +2 -0
  3. package/deps/rocksdb/rocksdb/CMakeLists.txt +9 -0
  4. package/deps/rocksdb/rocksdb/Makefile +16 -5
  5. package/deps/rocksdb/rocksdb/TARGETS +23 -2
  6. package/deps/rocksdb/rocksdb/cmake/modules/CxxFlags.cmake +7 -0
  7. package/deps/rocksdb/rocksdb/cmake/modules/FindJeMalloc.cmake +29 -0
  8. package/deps/rocksdb/rocksdb/cmake/modules/FindNUMA.cmake +29 -0
  9. package/deps/rocksdb/rocksdb/cmake/modules/FindSnappy.cmake +29 -0
  10. package/deps/rocksdb/rocksdb/cmake/modules/FindTBB.cmake +33 -0
  11. package/deps/rocksdb/rocksdb/cmake/modules/Findgflags.cmake +29 -0
  12. package/deps/rocksdb/rocksdb/cmake/modules/Findlz4.cmake +29 -0
  13. package/deps/rocksdb/rocksdb/cmake/modules/Finduring.cmake +26 -0
  14. package/deps/rocksdb/rocksdb/cmake/modules/Findzstd.cmake +29 -0
  15. package/deps/rocksdb/rocksdb/cmake/modules/ReadVersion.cmake +10 -0
  16. package/deps/rocksdb/rocksdb/db/builder.cc +12 -4
  17. package/deps/rocksdb/rocksdb/db/c.cc +26 -0
  18. package/deps/rocksdb/rocksdb/db/c_test.c +3 -0
  19. package/deps/rocksdb/rocksdb/db/column_family.cc +8 -2
  20. package/deps/rocksdb/rocksdb/db/compaction/compaction_job.cc +29 -6
  21. package/deps/rocksdb/rocksdb/db/compaction/compaction_job.h +8 -2
  22. package/deps/rocksdb/rocksdb/db/compaction/compaction_job_test.cc +16 -4
  23. package/deps/rocksdb/rocksdb/db/compaction/compaction_picker_test.cc +2 -1
  24. package/deps/rocksdb/rocksdb/db/compaction/compaction_service_test.cc +16 -0
  25. package/deps/rocksdb/rocksdb/db/db_basic_test.cc +402 -30
  26. package/deps/rocksdb/rocksdb/db/db_impl/db_impl.cc +2 -12
  27. package/deps/rocksdb/rocksdb/db/db_impl/db_impl.h +14 -0
  28. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_compaction_flush.cc +7 -5
  29. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_experimental.cc +1 -1
  30. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_open.cc +33 -7
  31. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_readonly.cc +54 -23
  32. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_readonly.h +3 -0
  33. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_secondary.cc +8 -1
  34. package/deps/rocksdb/rocksdb/db/db_options_test.cc +16 -0
  35. package/deps/rocksdb/rocksdb/db/db_rate_limiter_test.cc +14 -15
  36. package/deps/rocksdb/rocksdb/db/db_readonly_with_timestamp_test.cc +331 -0
  37. package/deps/rocksdb/rocksdb/db/db_secondary_test.cc +5 -0
  38. package/deps/rocksdb/rocksdb/db/db_test.cc +16 -0
  39. package/deps/rocksdb/rocksdb/db/db_test2.cc +221 -92
  40. package/deps/rocksdb/rocksdb/db/db_test_util.cc +6 -2
  41. package/deps/rocksdb/rocksdb/db/db_test_util.h +4 -2
  42. package/deps/rocksdb/rocksdb/db/db_with_timestamp_basic_test.cc +1 -171
  43. package/deps/rocksdb/rocksdb/db/db_with_timestamp_test_util.cc +96 -0
  44. package/deps/rocksdb/rocksdb/db/db_with_timestamp_test_util.h +126 -0
  45. package/deps/rocksdb/rocksdb/db/experimental.cc +1 -1
  46. package/deps/rocksdb/rocksdb/db/external_sst_file_basic_test.cc +57 -0
  47. package/deps/rocksdb/rocksdb/db/external_sst_file_ingestion_job.cc +13 -2
  48. package/deps/rocksdb/rocksdb/db/external_sst_file_ingestion_job.h +2 -0
  49. package/deps/rocksdb/rocksdb/db/flush_job.cc +10 -11
  50. package/deps/rocksdb/rocksdb/db/import_column_family_job.cc +11 -1
  51. package/deps/rocksdb/rocksdb/db/import_column_family_test.cc +6 -0
  52. package/deps/rocksdb/rocksdb/db/repair.cc +12 -1
  53. package/deps/rocksdb/rocksdb/db/repair_test.cc +32 -10
  54. package/deps/rocksdb/rocksdb/db/snapshot_impl.h +3 -1
  55. package/deps/rocksdb/rocksdb/db/table_cache.cc +19 -127
  56. package/deps/rocksdb/rocksdb/db/table_cache.h +3 -2
  57. package/deps/rocksdb/rocksdb/db/table_cache_sync_and_async.h +140 -0
  58. package/deps/rocksdb/rocksdb/db/version_builder_test.cc +130 -128
  59. package/deps/rocksdb/rocksdb/db/version_edit.cc +20 -0
  60. package/deps/rocksdb/rocksdb/db/version_edit.h +13 -4
  61. package/deps/rocksdb/rocksdb/db/version_edit_test.cc +14 -14
  62. package/deps/rocksdb/rocksdb/db/version_set.cc +205 -212
  63. package/deps/rocksdb/rocksdb/db/version_set.h +11 -0
  64. package/deps/rocksdb/rocksdb/db/version_set_sync_and_async.h +154 -0
  65. package/deps/rocksdb/rocksdb/db/version_set_test.cc +10 -9
  66. package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_common.h +2 -0
  67. package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_gflags.cc +13 -0
  68. package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_test_base.cc +15 -0
  69. package/deps/rocksdb/rocksdb/file/file_prefetch_buffer.cc +159 -65
  70. package/deps/rocksdb/rocksdb/file/file_prefetch_buffer.h +43 -21
  71. package/deps/rocksdb/rocksdb/file/prefetch_test.cc +142 -17
  72. package/deps/rocksdb/rocksdb/file/writable_file_writer.cc +23 -27
  73. package/deps/rocksdb/rocksdb/file/writable_file_writer.h +2 -3
  74. package/deps/rocksdb/rocksdb/include/rocksdb/advanced_options.h +23 -5
  75. package/deps/rocksdb/rocksdb/include/rocksdb/c.h +14 -1
  76. package/deps/rocksdb/rocksdb/include/rocksdb/file_system.h +2 -0
  77. package/deps/rocksdb/rocksdb/include/rocksdb/options.h +17 -0
  78. package/deps/rocksdb/rocksdb/include/rocksdb/perf_context.h +2 -0
  79. package/deps/rocksdb/rocksdb/include/rocksdb/snapshot.h +4 -1
  80. package/deps/rocksdb/rocksdb/include/rocksdb/statistics.h +3 -0
  81. package/deps/rocksdb/rocksdb/include/rocksdb/utilities/options_type.h +189 -0
  82. package/deps/rocksdb/rocksdb/include/rocksdb/version.h +1 -1
  83. package/deps/rocksdb/rocksdb/monitoring/perf_context.cc +5 -0
  84. package/deps/rocksdb/rocksdb/monitoring/statistics.cc +1 -1
  85. package/deps/rocksdb/rocksdb/options/cf_options.cc +13 -0
  86. package/deps/rocksdb/rocksdb/options/db_options.cc +8 -0
  87. package/deps/rocksdb/rocksdb/options/db_options.h +1 -0
  88. package/deps/rocksdb/rocksdb/options/options.cc +7 -0
  89. package/deps/rocksdb/rocksdb/options/options_helper.cc +4 -0
  90. package/deps/rocksdb/rocksdb/options/options_settable_test.cc +6 -4
  91. package/deps/rocksdb/rocksdb/options/options_test.cc +107 -9
  92. package/deps/rocksdb/rocksdb/src.mk +4 -1
  93. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_builder.cc +9 -4
  94. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_iterator.cc +80 -6
  95. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_iterator.h +8 -2
  96. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_reader.cc +81 -757
  97. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_reader.h +21 -15
  98. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_reader_impl.h +9 -3
  99. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_reader_sync_and_async.h +754 -0
  100. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_reader_test.cc +2 -1
  101. package/deps/rocksdb/rocksdb/table/block_based/block_prefetcher.cc +8 -0
  102. package/deps/rocksdb/rocksdb/table/block_based/filter_block.h +1 -10
  103. package/deps/rocksdb/rocksdb/table/block_based/filter_block_reader_common.cc +59 -1
  104. package/deps/rocksdb/rocksdb/table/block_based/filter_block_reader_common.h +18 -0
  105. package/deps/rocksdb/rocksdb/table/block_based/full_filter_block.cc +0 -61
  106. package/deps/rocksdb/rocksdb/table/block_based/full_filter_block.h +0 -13
  107. package/deps/rocksdb/rocksdb/table/block_based/index_reader_common.cc +1 -1
  108. package/deps/rocksdb/rocksdb/table/block_based/partitioned_filter_block.cc +3 -2
  109. package/deps/rocksdb/rocksdb/table/block_based/partitioned_index_iterator.cc +2 -2
  110. package/deps/rocksdb/rocksdb/table/block_based/partitioned_index_reader.cc +2 -1
  111. package/deps/rocksdb/rocksdb/table/block_based/uncompression_dict_reader.cc +2 -1
  112. package/deps/rocksdb/rocksdb/table/block_fetcher.cc +60 -2
  113. package/deps/rocksdb/rocksdb/table/block_fetcher.h +2 -0
  114. package/deps/rocksdb/rocksdb/table/merging_iterator.cc +39 -0
  115. package/deps/rocksdb/rocksdb/table/multiget_context.h +46 -2
  116. package/deps/rocksdb/rocksdb/table/sst_file_dumper.cc +2 -1
  117. package/deps/rocksdb/rocksdb/table/sst_file_dumper.h +1 -1
  118. package/deps/rocksdb/rocksdb/table/table_reader.h +13 -0
  119. package/deps/rocksdb/rocksdb/table/unique_id.cc +27 -0
  120. package/deps/rocksdb/rocksdb/table/unique_id_impl.h +3 -0
  121. package/deps/rocksdb/rocksdb/test_util/testutil.cc +2 -0
  122. package/deps/rocksdb/rocksdb/tools/db_bench_tool.cc +23 -7
  123. package/deps/rocksdb/rocksdb/tools/sst_dump_tool.cc +9 -1
  124. package/deps/rocksdb/rocksdb/util/async_file_reader.cc +72 -0
  125. package/deps/rocksdb/rocksdb/util/async_file_reader.h +144 -0
  126. package/deps/rocksdb/rocksdb/util/compression.h +49 -0
  127. package/deps/rocksdb/rocksdb/util/coro_utils.h +111 -0
  128. package/deps/rocksdb/rocksdb/util/single_thread_executor.h +55 -0
  129. package/deps/rocksdb/rocksdb.gyp +16 -15
  130. package/package-lock.json +23687 -0
  131. package/package.json +2 -30
  132. package/prebuilds/darwin-arm64/node.napi.node +0 -0
  133. package/prebuilds/darwin-x64/node.napi.node +0 -0
  134. package/prebuilds/linux-x64/node.napi.node +0 -0
  135. package/deps/liburing/liburing/README +0 -46
  136. package/deps/liburing/liburing/test/232c93d07b74-test.c +0 -305
  137. package/deps/liburing/liburing/test/35fa71a030ca-test.c +0 -329
  138. package/deps/liburing/liburing/test/500f9fbadef8-test.c +0 -89
  139. package/deps/liburing/liburing/test/7ad0e4b2f83c-test.c +0 -93
  140. package/deps/liburing/liburing/test/8a9973408177-test.c +0 -106
  141. package/deps/liburing/liburing/test/917257daa0fe-test.c +0 -53
  142. package/deps/liburing/liburing/test/Makefile +0 -312
  143. package/deps/liburing/liburing/test/a0908ae19763-test.c +0 -58
  144. package/deps/liburing/liburing/test/a4c0b3decb33-test.c +0 -180
  145. package/deps/liburing/liburing/test/accept-link.c +0 -251
  146. package/deps/liburing/liburing/test/accept-reuse.c +0 -164
  147. package/deps/liburing/liburing/test/accept-test.c +0 -79
  148. package/deps/liburing/liburing/test/accept.c +0 -476
  149. package/deps/liburing/liburing/test/across-fork.c +0 -283
  150. package/deps/liburing/liburing/test/b19062a56726-test.c +0 -53
  151. package/deps/liburing/liburing/test/b5837bd5311d-test.c +0 -77
  152. package/deps/liburing/liburing/test/ce593a6c480a-test.c +0 -135
  153. package/deps/liburing/liburing/test/close-opath.c +0 -122
  154. package/deps/liburing/liburing/test/config +0 -10
  155. package/deps/liburing/liburing/test/connect.c +0 -398
  156. package/deps/liburing/liburing/test/cq-full.c +0 -96
  157. package/deps/liburing/liburing/test/cq-overflow.c +0 -294
  158. package/deps/liburing/liburing/test/cq-peek-batch.c +0 -102
  159. package/deps/liburing/liburing/test/cq-ready.c +0 -94
  160. package/deps/liburing/liburing/test/cq-size.c +0 -58
  161. package/deps/liburing/liburing/test/d4ae271dfaae-test.c +0 -96
  162. package/deps/liburing/liburing/test/d77a67ed5f27-test.c +0 -65
  163. package/deps/liburing/liburing/test/defer.c +0 -307
  164. package/deps/liburing/liburing/test/double-poll-crash.c +0 -186
  165. package/deps/liburing/liburing/test/eeed8b54e0df-test.c +0 -114
  166. package/deps/liburing/liburing/test/empty-eownerdead.c +0 -42
  167. package/deps/liburing/liburing/test/eventfd-disable.c +0 -151
  168. package/deps/liburing/liburing/test/eventfd-ring.c +0 -97
  169. package/deps/liburing/liburing/test/eventfd.c +0 -112
  170. package/deps/liburing/liburing/test/fadvise.c +0 -202
  171. package/deps/liburing/liburing/test/fallocate.c +0 -249
  172. package/deps/liburing/liburing/test/fc2a85cb02ef-test.c +0 -138
  173. package/deps/liburing/liburing/test/file-register.c +0 -843
  174. package/deps/liburing/liburing/test/file-update.c +0 -173
  175. package/deps/liburing/liburing/test/files-exit-hang-poll.c +0 -128
  176. package/deps/liburing/liburing/test/files-exit-hang-timeout.c +0 -134
  177. package/deps/liburing/liburing/test/fixed-link.c +0 -90
  178. package/deps/liburing/liburing/test/fsync.c +0 -224
  179. package/deps/liburing/liburing/test/hardlink.c +0 -136
  180. package/deps/liburing/liburing/test/helpers.c +0 -135
  181. package/deps/liburing/liburing/test/helpers.h +0 -67
  182. package/deps/liburing/liburing/test/io-cancel.c +0 -537
  183. package/deps/liburing/liburing/test/io_uring_enter.c +0 -296
  184. package/deps/liburing/liburing/test/io_uring_register.c +0 -664
  185. package/deps/liburing/liburing/test/io_uring_setup.c +0 -192
  186. package/deps/liburing/liburing/test/iopoll.c +0 -366
  187. package/deps/liburing/liburing/test/lfs-openat-write.c +0 -117
  188. package/deps/liburing/liburing/test/lfs-openat.c +0 -273
  189. package/deps/liburing/liburing/test/link-timeout.c +0 -1107
  190. package/deps/liburing/liburing/test/link.c +0 -496
  191. package/deps/liburing/liburing/test/link_drain.c +0 -229
  192. package/deps/liburing/liburing/test/madvise.c +0 -195
  193. package/deps/liburing/liburing/test/mkdir.c +0 -108
  194. package/deps/liburing/liburing/test/multicqes_drain.c +0 -383
  195. package/deps/liburing/liburing/test/nop-all-sizes.c +0 -107
  196. package/deps/liburing/liburing/test/nop.c +0 -115
  197. package/deps/liburing/liburing/test/open-close.c +0 -146
  198. package/deps/liburing/liburing/test/openat2.c +0 -240
  199. package/deps/liburing/liburing/test/personality.c +0 -204
  200. package/deps/liburing/liburing/test/pipe-eof.c +0 -81
  201. package/deps/liburing/liburing/test/pipe-reuse.c +0 -105
  202. package/deps/liburing/liburing/test/poll-cancel-ton.c +0 -139
  203. package/deps/liburing/liburing/test/poll-cancel.c +0 -135
  204. package/deps/liburing/liburing/test/poll-link.c +0 -227
  205. package/deps/liburing/liburing/test/poll-many.c +0 -208
  206. package/deps/liburing/liburing/test/poll-mshot-update.c +0 -273
  207. package/deps/liburing/liburing/test/poll-ring.c +0 -48
  208. package/deps/liburing/liburing/test/poll-v-poll.c +0 -353
  209. package/deps/liburing/liburing/test/poll.c +0 -109
  210. package/deps/liburing/liburing/test/probe.c +0 -137
  211. package/deps/liburing/liburing/test/read-write.c +0 -876
  212. package/deps/liburing/liburing/test/register-restrictions.c +0 -633
  213. package/deps/liburing/liburing/test/rename.c +0 -134
  214. package/deps/liburing/liburing/test/ring-leak.c +0 -173
  215. package/deps/liburing/liburing/test/ring-leak2.c +0 -249
  216. package/deps/liburing/liburing/test/rsrc_tags.c +0 -449
  217. package/deps/liburing/liburing/test/runtests-loop.sh +0 -16
  218. package/deps/liburing/liburing/test/runtests.sh +0 -170
  219. package/deps/liburing/liburing/test/rw_merge_test.c +0 -97
  220. package/deps/liburing/liburing/test/self.c +0 -91
  221. package/deps/liburing/liburing/test/send_recv.c +0 -291
  222. package/deps/liburing/liburing/test/send_recvmsg.c +0 -345
  223. package/deps/liburing/liburing/test/sendmsg_fs_cve.c +0 -198
  224. package/deps/liburing/liburing/test/shared-wq.c +0 -84
  225. package/deps/liburing/liburing/test/short-read.c +0 -75
  226. package/deps/liburing/liburing/test/shutdown.c +0 -163
  227. package/deps/liburing/liburing/test/sigfd-deadlock.c +0 -74
  228. package/deps/liburing/liburing/test/socket-rw-eagain.c +0 -156
  229. package/deps/liburing/liburing/test/socket-rw.c +0 -147
  230. package/deps/liburing/liburing/test/splice.c +0 -511
  231. package/deps/liburing/liburing/test/sq-full-cpp.cc +0 -45
  232. package/deps/liburing/liburing/test/sq-full.c +0 -45
  233. package/deps/liburing/liburing/test/sq-poll-dup.c +0 -200
  234. package/deps/liburing/liburing/test/sq-poll-kthread.c +0 -168
  235. package/deps/liburing/liburing/test/sq-poll-share.c +0 -137
  236. package/deps/liburing/liburing/test/sq-space_left.c +0 -159
  237. package/deps/liburing/liburing/test/sqpoll-cancel-hang.c +0 -159
  238. package/deps/liburing/liburing/test/sqpoll-disable-exit.c +0 -195
  239. package/deps/liburing/liburing/test/sqpoll-exit-hang.c +0 -77
  240. package/deps/liburing/liburing/test/sqpoll-sleep.c +0 -68
  241. package/deps/liburing/liburing/test/statx.c +0 -172
  242. package/deps/liburing/liburing/test/stdout.c +0 -232
  243. package/deps/liburing/liburing/test/submit-link-fail.c +0 -154
  244. package/deps/liburing/liburing/test/submit-reuse.c +0 -239
  245. package/deps/liburing/liburing/test/symlink.c +0 -116
  246. package/deps/liburing/liburing/test/teardowns.c +0 -58
  247. package/deps/liburing/liburing/test/thread-exit.c +0 -131
  248. package/deps/liburing/liburing/test/timeout-new.c +0 -246
  249. package/deps/liburing/liburing/test/timeout-overflow.c +0 -204
  250. package/deps/liburing/liburing/test/timeout.c +0 -1354
  251. package/deps/liburing/liburing/test/unlink.c +0 -111
  252. package/deps/liburing/liburing/test/wakeup-hang.c +0 -162
  253. package/deps/rocksdb/rocksdb/README.md +0 -32
  254. package/deps/rocksdb/rocksdb/microbench/README.md +0 -60
  255. package/deps/rocksdb/rocksdb/plugin/README.md +0 -43
  256. package/deps/rocksdb/rocksdb/port/README +0 -10
  257. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/README +0 -13
@@ -1,111 +0,0 @@
1
- /* SPDX-License-Identifier: MIT */
2
- /*
3
- * Description: run various nop tests
4
- *
5
- */
6
- #include <errno.h>
7
- #include <stdio.h>
8
- #include <unistd.h>
9
- #include <stdlib.h>
10
- #include <string.h>
11
- #include <fcntl.h>
12
-
13
- #include "liburing.h"
14
-
15
- static int test_unlink(struct io_uring *ring, const char *old)
16
- {
17
- struct io_uring_cqe *cqe;
18
- struct io_uring_sqe *sqe;
19
- int ret;
20
-
21
- sqe = io_uring_get_sqe(ring);
22
- if (!sqe) {
23
- fprintf(stderr, "get sqe failed\n");
24
- goto err;
25
- }
26
- io_uring_prep_unlinkat(sqe, AT_FDCWD, old, 0);
27
-
28
- ret = io_uring_submit(ring);
29
- if (ret <= 0) {
30
- fprintf(stderr, "sqe submit failed: %d\n", ret);
31
- goto err;
32
- }
33
-
34
- ret = io_uring_wait_cqe(ring, &cqe);
35
- if (ret < 0) {
36
- fprintf(stderr, "wait completion %d\n", ret);
37
- goto err;
38
- }
39
- ret = cqe->res;
40
- io_uring_cqe_seen(ring, cqe);
41
- return ret;
42
- err:
43
- return 1;
44
- }
45
-
46
- static int stat_file(const char *buf)
47
- {
48
- struct stat sb;
49
-
50
- if (!stat(buf, &sb))
51
- return 0;
52
-
53
- return errno;
54
- }
55
-
56
- int main(int argc, char *argv[])
57
- {
58
- struct io_uring ring;
59
- char buf[32] = "./XXXXXX";
60
- int ret;
61
-
62
- if (argc > 1)
63
- return 0;
64
-
65
- ret = io_uring_queue_init(1, &ring, 0);
66
- if (ret) {
67
- fprintf(stderr, "ring setup failed: %d\n", ret);
68
- return 1;
69
- }
70
-
71
- ret = mkstemp(buf);
72
- if (ret < 0) {
73
- perror("mkstemp");
74
- return 1;
75
- }
76
- close(ret);
77
-
78
- if (stat_file(buf) != 0) {
79
- perror("stat");
80
- return 1;
81
- }
82
-
83
- ret = test_unlink(&ring, buf);
84
- if (ret < 0) {
85
- if (ret == -EBADF || ret == -EINVAL) {
86
- fprintf(stdout, "Unlink not supported, skipping\n");
87
- unlink(buf);
88
- return 0;
89
- }
90
- fprintf(stderr, "rename: %s\n", strerror(-ret));
91
- goto err;
92
- } else if (ret)
93
- goto err;
94
-
95
- ret = stat_file(buf);
96
- if (ret != ENOENT) {
97
- fprintf(stderr, "stat got %s\n", strerror(ret));
98
- return 1;
99
- }
100
-
101
- ret = test_unlink(&ring, "/3/2/3/1/z/y");
102
- if (ret != -ENOENT) {
103
- fprintf(stderr, "invalid unlink got %s\n", strerror(-ret));
104
- return 1;
105
- }
106
-
107
- return 0;
108
- err:
109
- unlink(buf);
110
- return 1;
111
- }
@@ -1,162 +0,0 @@
1
- /* SPDX-License-Identifier: MIT */
2
- #include <sys/eventfd.h>
3
- #include <unistd.h>
4
- #include <stdio.h>
5
- #include <stdlib.h>
6
- #include <string.h>
7
- #include <pthread.h>
8
- #include <liburing.h>
9
- #include <fcntl.h>
10
- #include <poll.h>
11
- #include <sys/time.h>
12
-
13
- struct thread_data {
14
- struct io_uring *ring;
15
- int write_fd;
16
- };
17
-
18
- static void error_exit(char *message)
19
- {
20
- perror(message);
21
- exit(1);
22
- }
23
-
24
- static void *listener_thread(void *data)
25
- {
26
- struct thread_data *td = data;
27
- struct io_uring_cqe *cqe;
28
- int ret;
29
-
30
- ret = io_uring_wait_cqe(td->ring, &cqe);
31
- if (ret < 0) {
32
- fprintf(stderr, "Error waiting for completion: %s\n",
33
- strerror(-ret));
34
- goto err;
35
- }
36
- if (cqe->res < 0) {
37
- fprintf(stderr, "Error in async operation: %s\n", strerror(-cqe->res));
38
- goto err;
39
- }
40
- io_uring_cqe_seen(td->ring, cqe);
41
- return NULL;
42
- err:
43
- return (void *) 1;
44
- }
45
-
46
- static void *wakeup_io_uring(void *data)
47
- {
48
- struct thread_data *td = data;
49
- int res;
50
-
51
- res = eventfd_write(td->write_fd, (eventfd_t) 1L);
52
- if (res < 0) {
53
- perror("eventfd_write");
54
- return (void *) 1;
55
- }
56
- return NULL;
57
- }
58
-
59
- static int test_pipes(void)
60
- {
61
- struct io_uring_sqe *sqe;
62
- struct thread_data td;
63
- struct io_uring ring;
64
- pthread_t t1, t2;
65
- int ret, fds[2];
66
- void *pret;
67
-
68
- if (pipe(fds) < 0)
69
- error_exit("eventfd");
70
-
71
- ret = io_uring_queue_init(8, &ring, 0);
72
- if (ret) {
73
- fprintf(stderr, "Unable to setup io_uring: %s\n", strerror(-ret));
74
- return 1;
75
- }
76
-
77
- td.write_fd = fds[1];
78
- td.ring = &ring;
79
-
80
- sqe = io_uring_get_sqe(&ring);
81
- io_uring_prep_poll_add(sqe, fds[0], POLLIN);
82
- sqe->user_data = 2;
83
- ret = io_uring_submit(&ring);
84
- if (ret != 1) {
85
- fprintf(stderr, "ring_submit=%d\n", ret);
86
- return 1;
87
- }
88
-
89
- pthread_create(&t1, NULL, listener_thread, &td);
90
-
91
- sleep(1);
92
-
93
- pthread_create(&t2, NULL, wakeup_io_uring, &td);
94
- pthread_join(t1, &pret);
95
-
96
- io_uring_queue_exit(&ring);
97
- return pret != NULL;
98
- }
99
-
100
- static int test_eventfd(void)
101
- {
102
- struct io_uring_sqe *sqe;
103
- struct thread_data td;
104
- struct io_uring ring;
105
- pthread_t t1, t2;
106
- int efd, ret;
107
- void *pret;
108
-
109
- efd = eventfd(0, 0);
110
- if (efd < 0)
111
- error_exit("eventfd");
112
-
113
- ret = io_uring_queue_init(8, &ring, 0);
114
- if (ret) {
115
- fprintf(stderr, "Unable to setup io_uring: %s\n", strerror(-ret));
116
- return 1;
117
- }
118
-
119
- td.write_fd = efd;
120
- td.ring = &ring;
121
-
122
- sqe = io_uring_get_sqe(&ring);
123
- io_uring_prep_poll_add(sqe, efd, POLLIN);
124
- sqe->user_data = 2;
125
- ret = io_uring_submit(&ring);
126
- if (ret != 1) {
127
- fprintf(stderr, "ring_submit=%d\n", ret);
128
- return 1;
129
- }
130
-
131
- pthread_create(&t1, NULL, listener_thread, &td);
132
-
133
- sleep(1);
134
-
135
- pthread_create(&t2, NULL, wakeup_io_uring, &td);
136
- pthread_join(t1, &pret);
137
-
138
- io_uring_queue_exit(&ring);
139
- return pret != NULL;
140
- }
141
-
142
- int main(int argc, char *argv[])
143
- {
144
- int ret;
145
-
146
- if (argc > 1)
147
- return 0;
148
-
149
- ret = test_pipes();
150
- if (ret) {
151
- fprintf(stderr, "test_pipe failed\n");
152
- return ret;
153
- }
154
-
155
- ret = test_eventfd();
156
- if (ret) {
157
- fprintf(stderr, "test_eventfd failed\n");
158
- return ret;
159
- }
160
-
161
- return 0;
162
- }
@@ -1,32 +0,0 @@
1
- ## RocksDB: A Persistent Key-Value Store for Flash and RAM Storage
2
-
3
- [![CircleCI Status](https://circleci.com/gh/facebook/rocksdb.svg?style=svg)](https://circleci.com/gh/facebook/rocksdb)
4
- [![TravisCI Status](https://api.travis-ci.com/facebook/rocksdb.svg?branch=main)](https://travis-ci.com/github/facebook/rocksdb)
5
- [![Appveyor Build status](https://ci.appveyor.com/api/projects/status/fbgfu0so3afcno78/branch/main?svg=true)](https://ci.appveyor.com/project/Facebook/rocksdb/branch/main)
6
- [![PPC64le Build Status](http://140-211-168-68-openstack.osuosl.org:8080/buildStatus/icon?job=rocksdb&style=plastic)](http://140-211-168-68-openstack.osuosl.org:8080/job/rocksdb)
7
-
8
- RocksDB is developed and maintained by Facebook Database Engineering Team.
9
- It is built on earlier work on [LevelDB](https://github.com/google/leveldb) by Sanjay Ghemawat (sanjay@google.com)
10
- and Jeff Dean (jeff@google.com)
11
-
12
- This code is a library that forms the core building block for a fast
13
- key-value server, especially suited for storing data on flash drives.
14
- It has a Log-Structured-Merge-Database (LSM) design with flexible tradeoffs
15
- between Write-Amplification-Factor (WAF), Read-Amplification-Factor (RAF)
16
- and Space-Amplification-Factor (SAF). It has multi-threaded compactions,
17
- making it especially suitable for storing multiple terabytes of data in a
18
- single database.
19
-
20
- Start with example usage here: https://github.com/facebook/rocksdb/tree/main/examples
21
-
22
- See the [github wiki](https://github.com/facebook/rocksdb/wiki) for more explanation.
23
-
24
- The public interface is in `include/`. Callers should not include or
25
- rely on the details of any other header files in this package. Those
26
- internal APIs may be changed without warning.
27
-
28
- Questions and discussions are welcome on the [RocksDB Developers Public](https://www.facebook.com/groups/rocksdb.dev/) Facebook group and [email list](https://groups.google.com/g/rocksdb) on Google Groups.
29
-
30
- ## License
31
-
32
- RocksDB is dual-licensed under both the GPLv2 (found in the COPYING file in the root directory) and Apache 2.0 License (found in the LICENSE.Apache file in the root directory). You may select, at your option, one of the above-listed licenses.
@@ -1,60 +0,0 @@
1
- # RocksDB Micro-Benchmark
2
-
3
- ## Overview
4
-
5
- RocksDB micro-benchmark is a set of tests for benchmarking a single component or simple DB operations. The test artificially generates input data and executes the same operation with it to collect and report performance metrics. As it's focusing on testing a single, well-defined operation, the result is more precise and reproducible, which also has its limitation of not representing a real production use case. The test author needs to carefully design the microbench to represent its true purpose.
6
-
7
- The tests are based on [Google Benchmark](https://github.com/google/benchmark) library, which provides a standard framework for writing benchmarks.
8
-
9
- ## How to Run
10
- ### Prerequisite
11
- Install the [Google Benchmark](https://github.com/google/benchmark) version `1.6.0` or above.
12
-
13
- *Note: Google Benchmark `1.6.x` is incompatible with previous versions like `1.5.x`, please make sure you're using the newer version.*
14
-
15
- ### Build and Run
16
- With `Makefile`:
17
- ```bash
18
- $ DEBUG_LEVEL=0 make run_microbench
19
- ```
20
- Or with cmake:
21
- ```bash
22
- $ mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DWITH_BENCHMARK
23
- $ make run_microbench
24
- ```
25
-
26
- *Note: Please run the benchmark code in release build.*
27
- ### Run Single Test
28
- Example:
29
- ```bash
30
- $ make db_basic_bench
31
- $ ./db_basic_bench --benchmark_filter=<TEST_NAME>
32
- ```
33
-
34
- ## Best Practices
35
- #### * Use the Same Test Directory Setting as Unittest
36
- Most of the Micro-benchmark tests use the same test directory setup as unittest, so it could be overridden by:
37
- ```bash
38
- $ TEST_TMPDIR=/mydata/tmp/ ./db_basic_bench --benchmark_filter=<TEST_NAME>
39
- ```
40
- Please also follow that when designing new tests.
41
-
42
- #### * Avoid Using Debug API
43
- Even though micro-benchmark is a test, avoid using internal Debug API like TEST_WaitForRun() which is designed for unittest. As benchmark tests are designed for release build, don't use any of that.
44
-
45
- #### * Pay Attention to Local Optimization
46
- As a micro-benchmark is focusing on a single component or area, make sure it is a key part for impacting the overall application performance.
47
-
48
- The compiler might be able to optimize the code that not the same way as the whole application, and if the test data input is simple and small, it may be able to all cached in CPU memory, which is leading to a wrong metric. Take these into consideration when designing the tests.
49
-
50
- #### * Names of user-defined counters/metrics has to be `[A-Za-z0-9_]`
51
- It's a restriction of the metrics collecting and reporting system RocksDB is using internally. It will also help integrate with more systems.
52
-
53
- #### * Minimize the Metrics Variation
54
- Try reducing the test result variation, one way to check that is running the test multiple times and check the CV (Coefficient of Variation) reported by gbenchmark.
55
- ```bash
56
- $ ./db_basic_bench --benchmark_filter=<TEST_NAME> --benchmark_repetitions=10
57
- ...
58
- <TEST_NAME>_cv 3.2%
59
- ```
60
- RocksDB has background compaction jobs which may cause the test result to vary a lot. If the micro-benchmark is not purposely testing the operation while compaction is in progress, it should wait for the compaction to finish (`db_impl->WaitForCompact()`) or disable auto-compaction.
@@ -1,43 +0,0 @@
1
- ## Building external plugins together with RocksDB
2
-
3
- RocksDB offers several plugin interfaces for developers to customize its behavior. One difficulty developers face is how to make their plugin available to end users. The approach discussed here involves building the external code together with the RocksDB code into a single binary. Note another approach we plan to support involves loading plugins dynamically from shared libraries.
4
-
5
- ### Discovery
6
-
7
- We hope developers will mention their work in "PLUGINS.md" so users can easily discover and reuse solutions for customizing RocksDB.
8
-
9
- ### Directory organization
10
-
11
- External plugins will be linked according to their name into a subdirectory of "plugin/". For example, a plugin called "dedupfs" would be linked into "plugin/dedupfs/".
12
-
13
- ### Build standard
14
-
15
- Currently the only supported build system are make and cmake.
16
-
17
- For make, files in the plugin directory ending in the .mk extension can define the following variables.
18
-
19
- * `$(PLUGIN_NAME)_SOURCES`: these files will be compiled and linked with RocksDB. They can access RocksDB public header files.
20
- * `$(PLUGIN_NAME)_HEADERS`: these files will be installed in the RocksDB header directory. Their paths will be prefixed by "rocksdb/plugin/$(PLUGIN_NAME)/".
21
- * `$(PLUGIN_NAME)_LDFLAGS`: these flags will be passed to the final link step. For example, library dependencies can be propagated here, or symbols can be forcibly included, e.g., for static registration.
22
- * `$(PLUGIN_NAME)_CXXFLAGS`: these flags will be passed to the compiler. For example, they can specify locations of header files in non-standard locations.
23
-
24
- Users will run the usual make commands from the RocksDB directory, specifying the plugins to include in a space-separated list in the variable `ROCKSDB_PLUGINS`.
25
-
26
- For CMake, the CMakeLists.txt file in the plugin directory can define the following variables.
27
-
28
- * `${PLUGIN_NAME}_SOURCES`: these files will be compiled and linked with RocksDB. They can access RocksDB public header files.
29
- * `${PLUGIN_NAME}_COMPILE_FLAGS`: these flags will be passed to the compiler. For example, they can specify locations of header files in non-standard locations.
30
- * `${PLUGIN_NAME}_INCLUDE_PATHS`: paths to directories to search for plugin-specific header files during compilation.
31
- * `${PLUGIN_NAME}_LIBS`: list of library names required to build the plugin, e.g. `dl`, `java`, `jvm`, `rados`, etc. CMake will generate proper flags for linking.
32
- * `${PLUGIN_NAME}_LINK_PATHS`: list of paths for the linker to search for required libraries in additional to standard locations.
33
- * `${PLUGIN_NAME}_CMAKE_SHARED_LINKER_FLAGS` additional linker flags used to generate shared libraries. For example, symbols can be forcibly included, e.g., for static registration.
34
- * `${PLUGIN_NAME}_CMAKE_EXE_LINKER_FLAGS`: additional linker flags used to generate executables. For example, symbols can be forcibly included, e.g., for static registration.
35
-
36
- Users will run the usual cmake commands, specifying the plugins to include in a space-separated list in the command line variable `ROCKSDB_PLUGINS` when invoking cmake.
37
- ```
38
- cmake .. -DROCKSDB_PLUGINS="dedupfs hdfs rados"
39
- ```
40
-
41
- ### Example
42
-
43
- For a working example, see [Dedupfs](https://github.com/ajkr/dedupfs).
@@ -1,10 +0,0 @@
1
- This directory contains interfaces and implementations that isolate the
2
- rest of the package from platform details.
3
-
4
- Code in the rest of the package includes "port.h" from this directory.
5
- "port.h" in turn includes a platform specific "port_<platform>.h" file
6
- that provides the platform specific implementation.
7
-
8
- See port_posix.h for an example of what must be provided in a platform
9
- specific header file.
10
-
@@ -1,13 +0,0 @@
1
- The files in this directory originally come from
2
- https://github.com/percona/PerconaFT/.
3
-
4
- This directory only includes the "locktree" part of PerconaFT, and its
5
- dependencies.
6
-
7
- The following modifications were made:
8
- - Make locktree usable outside of PerconaFT library
9
- - Add shared read-only lock support
10
-
11
- The files named *_subst.* are substitutes of the PerconaFT's files, they
12
- contain replacements of PerconaFT's functionality.
13
-