Skip to content

Commit

Permalink
Adapt rocksdb 6.29.3 (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
linxGnu authored Mar 9, 2022
1 parent fcdfa06 commit 8b6fe71
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
uses: actions/cache@v2
with:
path: dist
key: v6.28.2
key: v6.29.3

- name: Build
if: steps.cache-built-rocksdb.outputs.cache-hit != 'true'
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ cd $BUILD_PATH && wget https://github.com/facebook/zstd/archive/v${zstd_version}
-DCMAKE_POSITION_INDEPENDENT_CODE=ON -DZSTD_ZLIB_SUPPORT=ON -DZSTD_LZMA_SUPPORT=OFF -DCMAKE_BUILD_TYPE=Release .. && make -j$(nproc) install && \
cd $BUILD_PATH && rm -rf * && ldconfig

rocksdb_version="6.28.2"
rocksdb_version="6.29.3"
cd $BUILD_PATH && wget https://github.com/facebook/rocksdb/archive/v${rocksdb_version}.tar.gz && tar xzf v${rocksdb_version}.tar.gz && cd rocksdb-${rocksdb_version}/ && \
mkdir -p build_place && cd build_place && cmake -DCMAKE_BUILD_TYPE=Release $CMAKE_REQUIRED_PARAMS -DCMAKE_PREFIX_PATH=$INSTALL_PREFIX -DWITH_TESTS=OFF -DWITH_GFLAGS=OFF \
-DWITH_BENCHMARK_TOOLS=OFF -DWITH_TOOLS=OFF -DWITH_MD_LIBRARY=OFF -DWITH_RUNTIME_DEBUG=OFF -DROCKSDB_BUILD_SHARED=OFF -DWITH_SNAPPY=ON -DWITH_LZ4=ON -DWITH_ZLIB=ON \
Expand Down
2 changes: 1 addition & 1 deletion c.h
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ extern ROCKSDB_LIBRARY_API void rocksdb_options_set_merge_operator(
extern ROCKSDB_LIBRARY_API void rocksdb_options_set_uint64add_merge_operator(
rocksdb_options_t*);
extern ROCKSDB_LIBRARY_API void rocksdb_options_set_compression_per_level(
rocksdb_options_t* opt, int* level_values, size_t num_levels);
rocksdb_options_t* opt, const int* level_values, size_t num_levels);
extern ROCKSDB_LIBRARY_API void rocksdb_options_set_create_if_missing(
rocksdb_options_t*, unsigned char);
extern ROCKSDB_LIBRARY_API unsigned char rocksdb_options_get_create_if_missing(
Expand Down
5 changes: 5 additions & 0 deletions comparator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package grocksdb

import (
"bytes"
"runtime"
"testing"

"github.com/stretchr/testify/require"
Expand All @@ -18,11 +19,14 @@ func TestComparator(t *testing.T) {
opts.Destroy()
}()

runtime.GC()

// insert keys
givenKeys := [][]byte{[]byte("key1"), []byte("key2"), []byte("key3")}
wo := NewDefaultWriteOptions()
for _, k := range givenKeys {
require.Nil(t, db.Put(wo, k, []byte("val")))
runtime.GC()
}

// create a iterator to collect the keys
Expand All @@ -37,6 +41,7 @@ func TestComparator(t *testing.T) {
key := make([]byte, 4)
copy(key, iter.Key().Data())
actualKeys = append(actualKeys, key)
runtime.GC()
}
require.Nil(t, iter.Err())

Expand Down

0 comments on commit 8b6fe71

Please sign in to comment.