summaryrefslogtreecommitdiff
path: root/db
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #893 from myccccccc:masterVictor Costan2022-01-101-2/+0
|\ | | | | | | PiperOrigin-RevId: 420783873
| * delete an unnecessary forward declarationmayingchun2021-04-051-2/+0
| |
* | Merge pull request #652 from caodhuan:masterVictor Costan2022-01-101-0/+1
|\ \ | | | | | | | | | PiperOrigin-RevId: 420782536
| * | add:compact_pointers_ should be clear when Clear() calledcaodhuan2019-01-221-0/+1
| | |
* | | Merge pull request #602 from andyli029:feature_fix_lack_tag_commentVictor Costan2022-01-101-0/+1
|\ \ \ | | | | | | | | | | | | PiperOrigin-RevId: 420781095
| * | | lack of sequence and type in comments to introduce entry formatandy2018-06-281-0/+1
| | | |
* | | | Merge pull request #897 from raynolmenezes:patch-1Victor Costan2022-01-101-1/+1
|\ \ \ \ | | | | | | | | | | | | | | | PiperOrigin-RevId: 420662891
| * | | | Update log_reader.hRaynol Menezes2021-04-161-1/+1
| | |_|/ | |/| |
* | | | Merge pull request #934 from BilyZ98:masterVictor Costan2022-01-101-1/+1
|\ \ \ \ | | | | | | | | | | | | | | | PiperOrigin-RevId: 420645080
| * | | | Fix version_set.cc comments typozzt2021-09-031-1/+1
| | | | | | | | | | | | | | | Fix typo of comment of FindLargestKey function
* | | | | Merge pull request #928 from ehds:fix-commentVictor Costan2022-01-091-3/+3
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | PiperOrigin-RevId: 420541137
| * | | | | Fix comments positionehds2021-08-081-3/+3
| | | | | |
* | | | | | Merge pull request #960 from ericuni:dedupVictor Costan2022-01-091-1/+0
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | PiperOrigin-RevId: 420534594
| * | | | | | rm redundant code: SetNextFile has already been called before in this functionEric Wang2021-12-051-1/+0
| | |/ / / / | |/| | | |
* | | | | | VersionSet::Builder::Apply() does not mutate its argument.Victor Costan2022-01-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | PiperOrigin-RevId: 420533763
* | | | | | Merge pull request #903 from LazyWolfLin:dev_randomVictor Costan2022-01-091-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | PiperOrigin-RevId: 420532625
| * | | | | | Small fix.LazyWolfLin2021-05-111-1/+1
| | |_|/ / / | |/| | | | | | | | | | | | | | | | Use function instead of original expression.
* | | | | | Merge pull request #902 from ehds:update-table-cacheVictor Costan2022-01-091-0/+4
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | PiperOrigin-RevId: 420517390
| * | | | | | Make table cache non-copyableehds2021-05-081-0/+4
| |/ / / / /
* | | | | | Fix typosDimitris Apostolou2022-01-051-1/+1
| | | | | |
* | | | | | Remove main() from most tests.Victor Costan2022-01-0312-60/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This gives some flexibility to embedders. Currently, embedders have to build a binary for each test file. After this CL, embedders can still choose to have a binary for each test file, by linking each test file with a googletest target that includes main() (usually "gtest_main"). Embedders can also choose to build a single binary for almost all test files, and link with a googletest target that includes main(). The latter is more convenient for projects that have very few test binaries, like Chromium. PiperOrigin-RevId: 419470798
* | | | | | Extract benchmark from db_test.cc.Victor Costan2021-12-291-64/+0
| |/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The benchmark in db/db_test.cc is extracted to its own file, benchmarks/db_bench_log.cc. PiperOrigin-RevId: 418713499
* | | | | Remove the `/` prefix from the recovery_test test file to prevent a double `/`.leveldb Team2021-08-031-1/+1
| |/ / / |/| | | | | | | | | | | PiperOrigin-RevId: 388341429
* | | | Fix compactions that could end up breaking a run of the same userSanjay Ghemawat2021-05-201-0/+2
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | key across multiple files. As reported in Github issue #339, it is incorrect to split the same user key across multiple compacted files since it causes tombstones/newer-versions to be dropped, thereby exposing obsolete data. There was a fix for #339, but it ended up not fully fixing the problem. (It checked for boundary problems in the first level being compacted, but not the second). This problem was revealed by Github issue 887. We now adjust boundaries to avoid splitting user keys in both the first level and the second level. PiperOrigin-RevId: 374921082
* | | Use partial path to benchmark/benchmark.h.Chris Mumford2021-02-161-1/+1
| | | | | | | | | | | | | | | | | | | | | Using the partial path offers more flexibility to projects which may checkout google/benchmark to a different location. PiperOrigin-RevId: 357819911
* | | IWYU fixes in db/c.cc.Victor Costan2021-01-251-5/+8
| | | | | | | | | | | | | | | | | | Fixes https://github.com/google/leveldb/issues/872 PiperOrigin-RevId: 353657701
* | | Sync MANIFEST before closing in db_impl when creating a new DB.leveldb Team2021-01-122-0/+11
| | | | | | | | | | | | | | | | | | Add logging with debugging information when failing to load a version set. PiperOrigin-RevId: 351432332
* | | Optimize leveldb block seeks to utilize the current iterator location.leveldb Team2021-01-111-0/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is beneficial when iterators are reused and seeks are not random but increasing. It is additionally beneficial with larger block sizes and keys with common prefixes. Add a benchmark "seekordered" to db_bench that reuses iterators across increasing seeks. Add support to the benchmark to count comparisons made and to support common key prefix length. Change benchmark random seeds to be reproducible for entire benchmark suite executions but unique for threads in different benchmarks runs. This changes a benchmark suite of readrandom,seekrandom from having a 100% found ratio as previously it had the same seed used for fillrandom. ./db_bench --benchmarks=fillrandom,compact,seekordered --block_size=262144 --comparisons=1 --key_prefix=100 without this change (though with benchmark changes): seekrandom : 55.309 micros/op; (631820 of 1000000 found) Comparisons: 27001049 seekordered : 1.732 micros/op; (631882 of 1000000 found) Comparisons: 26998402 with this change: seekrandom : 55.866 micros/op; (631820 of 1000000 found) Comparisons: 26952143 seekordered : 1.686 micros/op; (631882 of 1000000 found) Comparisons: 25549369 For ordered seeking, this is a reduction of 5% comparisons and a 3% speedup. For random seeking (with single use iterators) the comparisons and speed are less than 1% and likely noise. PiperOrigin-RevId: 351149832
* | | Fixed fprintf of 64-bit value.Chris Mumford2020-11-301-1/+3
| | |
* | | Use external benchmark API headerleveldb Team2020-11-301-2/+2
| | | | | | | | | | | | PiperOrigin-RevId: 339310928
* | | Internal test cleanupleveldb Team2020-11-301-12/+9
| | | | | | | | | | | | PiperOrigin-RevId: 339287832
* | | Merge pull request #819 from wzk784533:masterVictor Costan2020-07-131-2/+5
|\ \ \ | | | | | | | | | | | | PiperOrigin-RevId: 321000544
| * | | avoid unnecessary memory copywzk7845332020-07-111-2/+5
|/ / /
* | | Add some std:: qualifiers to types and functions.Victor Costan2020-04-2917-94/+102
| | | | | | | | | | | | PiperOrigin-RevId: 309110431
* | | Switch from C headers to C++ headers.Victor Costan2020-04-2913-20/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL makes the following substitutions. * assert.h -> cassert * math.h -> cmath * stdarg.h -> cstdarg * stddef.h -> cstddef * stdint.h -> cstdint * stdio.h -> cstdio * stdlib.h -> cstdlib * string.h -> cstring PiperOrigin-RevId: 309080151
* | | Fix C++11 build.Victor Costan2020-04-281-0/+3
| | | | | | | | | | | | PiperOrigin-RevId: 308839805
* | | change const to constexprleveldb Team2020-04-281-2/+1
| | | | | | | | | | | | PiperOrigin-RevId: 307113877
* | | Remove Windows workarounds in some tests.Victor Costan2020-01-143-15/+0
| | | | | | | | | | | | | | | | | | | | | leveldb::Env::DeleteFile was replaced with leveldb::Env::RemoveFile in all tests. This allows us to remove workarounds for windows.h #defining DeleteFile. PiperOrigin-RevId: 289121105
* | | Add Env::Remove{File,Dir} which obsolete Env::Delete{File,Dir}.Victor Costan2020-01-0912-42/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "DeleteFile" method name causes pain for Windows developers, because <windows.h> #defines a DeleteFile macro to DeleteFileW or DeleteFileA. Current code uses workarounds, like #undefining DeleteFile everywhere an Env is declared, implemented, or used. This CL removes the need for workarounds by renaming Env::DeleteFile to Env::RemoveFile. For consistency, Env::DeleteDir is also renamed to Env::RemoveDir. A few internal methods are also renamed for consistency. Software that supports Windows is expected to migrate any Env implementations and usage to Remove{File,Dir}, and never use the name Env::Delete{File,Dir} in its code. The renaming is done in a backwards-compatible way, at the risk of making it slightly more difficult to build a new correct Env implementation. The backwards compatibility is achieved using the following hacks: 1) Env::Remove{File,Dir} methods are added, with a default implementation that calls into Env::Delete{File,Dir}. This makes old Env implementations compatible with code that calls into the updated API. 2) The Env::Delete{File,Dir} methods are no longer pure virtuals. Instead, they gain a default implementation that calls into Env::Remove{File,Dir}. This makes updated Env implementations compatible with code that calls into the old API. The cost of this approach is that it's possible to write an Env without overriding either Rename{File,Dir} or Delete{File,Dir}, without getting a compiler warning. However, attempting to run the test suite will immediately fail with an infinite call stack ending in {Remove,Delete}{File,Dir}, making developers aware of the problem. PiperOrigin-RevId: 288710907
* | | Defend against inclusion of windows.h in tests that invokeleveldb Team2020-01-093-0/+15
| | | | | | | | | | | | | | | | | | Env::DeleteFile. PiperOrigin-RevId: 283607548
* | | Internal change.leveldb Team2019-12-0212-12/+12
| | | | | | | | | | | | PiperOrigin-RevId: 282373286
* | | Switch testing harness to googletest.Victor Costan2019-11-2112-381/+418
| | | | | | | | | | | | PiperOrigin-RevId: 281815695
* | | Renamed local variable in DBImpl::Write.Chris Mumford2019-10-281-6/+6
| | | | | | | | | | | | | | | | | | | | | The local variable `updates` in DBImpl::Write was hiding the `updates` parameter. Renamed to avoid this conflict. PiperOrigin-RevId: 277089971
* | | Added return in Version::Get::State::Match to quiet warning.Chris Mumford2019-10-281-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added unreached return at the end of Version::Get::State::Match to stop this _incorrect_ warning: version_set.cc:376:5: warning: control reaches end of non-void function [-Wreturn-type] This warning was being emitted when building with clang 6.0.1-10 and also emitted by lgtm.com when statically analyzing leveldb even though all SaverState enumeration values were handled. PiperOrigin-RevId: 272455474
* | | Merge pull request #698 from neal-zhu:masterVictor Costan2019-08-281-77/+53
|\ \ \ | | | | | | | | | | | | PiperOrigin-RevId: 266001777
| * | | drop fileds in State that are duplicates of fileds in Saver and fix typoneal-zhu2019-08-281-12/+7
| | | |
| * | | cache Saver in State objectneal-zhu2019-06-121-21/+20
| | | |
| * | | fix bug(uninitialized options pointer in State)neal-zhu2019-06-121-7/+8
| | | |
| * | | remove TODO in Version::ForEachOverlappingneal-zhu2019-06-111-1/+0
| | | |
| * | | formatneal-zhu2019-06-111-6/+7
| | | |