70 Commits
Author SHA1 Message Date
Aman MangalandGitHub 85d4aac527 update .gitignore (#2176)
Related to #2175
2025-02-24 13:46:06 +05:30
Aman MangalandGitHub f0176aab66 Revert "Update badgerpb4.pb.go" (#2172)
This reverts commit a9c14388a1.
2025-02-14 09:05:38 -05:00
Aman MangalandGitHub eed86bce1f add changelog for v4.5.1 (#2152) 2025-01-21 23:48:27 +05:30
Aman MangalandGitHub f8b39c02d9 update changelog for v4.5.0 (#2132) 2024-12-01 13:51:44 -05:00
Aman MangalandGitHub c7545e4328 fix the cd pipeline (#2127) 2024-11-11 22:11:40 +00:00
Aman MangalandGitHub 319dc7ed79 set min Go version to v1.21 (#2126) 2024-11-11 20:57:36 +00:00
Aman MangalandGitHub 3d0d7f425f upgrade ristretto and use Go 1.21 (#2125) 2024-11-11 16:51:50 +05:30
Aman MangalandGitHub 514e37d0ef update changelog till v4.4.0 (#2123) 2024-11-10 21:52:30 -05:00
Aman MangalandGitHub 3220a35a10 retract v4.3.0 due to #2121 and #2113, upgrade to Go v1.23, use ristretto v2 (#2122)
Fixes #2121
2024-10-25 22:03:34 +05:30
Aman MangalandGitHub 942a12e8ad upgrade spf13/cobra to version v1.7.0 (#2001)
Fixes https://github.com/dgraph-io/badger/issues/1970
2023-09-09 18:04:07 +05:30
Aman MangalandGitHub ca543b2201 fix edge case for watermark when index is zero (#1999)
Fixes https://github.com/dgraph-io/badger/issues/1962

We have assumed that index won't be zero for a WaterMark but in badger's
unmanaged mode we start transactions with readTs = 0. This affects
oracle.readMark that could have values starting at 0.
2023-08-30 21:39:01 +05:30
Aman MangalandGitHub 3376167a4e chore(changelog): add a missed entry in CHANGELOG for v4.2.0 (#1988) 2023-08-07 08:25:46 +05:30
Aman MangalandGitHub 7dbd410c64 fix(stream): setup oracle correctly in stream writer (#1968) (#1904) 2023-06-12 10:32:15 +05:30
Aman MangalandGitHub c2804c2adf fix(stream): improve incremental stream writer (#1901)
This commit fails incremental stream writer if memtable has data. It
also allows calling incremental stream writer more times than the number
of levels we have. This is done by calling Flatten when we have reached
L0 and incremental stream writer can be used again after Flatten.
2023-06-12 10:07:05 +05:30
Aman MangalandGitHub 6292e73622 cleanup sstable file after tests (#1912) 2023-03-23 04:22:58 +05:30
Aman MangalandGitHub 633bae1a9c chore: upgrade xxhash from v1.1.0 to v2.1.2 (#1910)
fixes #1833
2023-03-20 17:47:26 +05:30
Aman MangalandGitHub c9ea4edac0 docs: fix the default value in docs (#1909)
fixes #1844
2023-03-20 17:45:49 +05:30
Aman MangalandGitHub 72cb4249dc sync the docs with README with projects using badger (#1903) 2023-03-09 23:09:42 +05:30
Aman MangalandGitHub 8f5bd6b446 feat(stream): add support for incremental stream writer (#1722) (#1874)
This PR adds support for stream writing incrementally to the DB.
Adds an API: StreamWriter.PrepareIncremental
2023-03-08 01:11:43 +05:30
Aman MangalandGitHub 968797c0e9 chore(memtable): refactor code for memtable flush (#1866)
removes the `flushTask` struct that was used in two different contexts.
2023-03-04 01:53:09 +05:30
Aman MangalandGitHub b5ce37e92c chore(bug): initialize the atomic variable (#1889) 2023-02-28 14:24:57 -06:00
Aman MangalandGitHub 4a93c43eac chore(linter): enable unconvert linter (#1881) 2023-02-22 23:32:29 +05:30
Aman MangalandGitHub 18972258dc chore: use atomic types instead (#1878) 2023-02-22 23:06:03 +05:30
Aman MangalandGitHub 1ba6cf56d8 compute block length accounting for compression (#1867)
Taken from PR #1698 and commit 9c3a516
2023-02-21 11:52:04 +05:30
Aman MangalandGitHub bbd4b3f95c chore: remove dependency on io/ioutil (#1879)
we still have a couple of places where we are using io/ioutil.
2023-02-21 08:06:07 +05:30
Aman MangalandGitHub aadabb0ee5 chores(linter): enable gosec linter (#1876) 2023-02-17 18:57:39 +05:30
Aman MangalandGitHub 14b0d32c59 chores(linter): enable rest of the linters (#1871) 2023-02-17 18:33:17 +05:30
Aman MangalandGitHub f83f87e90b fix order of imports (#1869) 2023-02-15 02:12:59 +05:30
Aman MangalandGitHub c25b87664d upgrade go to 1.19 (#1868) 2023-02-14 22:41:52 +05:30
Aman MangalandGitHub a472d2ad50 fix(linter): run go fmt on the repo (#1870) 2023-02-14 22:41:02 +05:30
Naman JainandNamanJain8 c985448cdf fix(compact): close vlog after the compaction at L0 has completed (#1752)
Vlog needs to stay open while the compaction is being run. With the CompactL0OnClose option, it becomes necessary to close the vlog after all the compactions have been completed.

(cherry picked from commit 921a6e2a86)
2021-10-05 14:28:16 +05:30
Naman JainandNamanJain8 da4c15aa11 fix(builder): put the upper limit on reallocation (#1748)
z.Allocator imposes an upper bound of 1GB on the size of the allocator. In builder, we double the allocation while reallocating to amortize the cost over the future allocations.

Consider a scenario where the size of KV is 700MB. The size of the allocator would be 700MB. Now we want to finish the block, so we will need some bytes for the metadata. That can easily fit into the remaining 324MB. But we were earlier doing over-allocation that causes panic.

(cherry picked from commit 3c1b8bcde2)
2021-10-05 14:27:13 +05:30
Naman JainandGitHub 7112da2baf chore: update changelog for v3.2103.1 (#1727)
(cherry picked from commit 4944ea7a535ef2c6eb28ea9d54cc31e17754a656)
2021-07-08 15:49:07 +05:30
Naman JainandNamanJain8 5b6068c6e1 fix(pendingWrites): don't skip the pending entries with version=0 (#1721)
With the introduction of SinceTs, a bug was introduced #1653 that skips the pending entries.
The default value of SinceTs is zero. And for the transaction made at readTs 0, the pending entries have version set to 0. So they were also getting skipped.

(cherry picked from commit 50276c44e2)
2021-07-08 15:13:26 +05:30
Naman JainandNamanJain8 1bd62ae759 fix(compaction): copy over the file ID when building tables #1713
(cherry picked from commit 9dcdf9fb8a)
2021-07-08 15:13:26 +05:30
Naman JainandNamanJain8 62614fa276 feat(zstd): replace datadog's zstd with Klauspost's zstd (#1709)
Remove Datadog's ZSTD that requires CGO
Make Klauspost's ZSTD as default

(cherry picked from commit 96e3a3146f)
2021-07-02 21:47:49 +05:30
Naman JainandNamanJain8 487f57bcf7 feat(compression): use klauspost zstd when cgo is not enabled (#1706)
Use https://github.com/klauspost/compress ZSTD compression when CGO is not enabled.
Related to #1383

(cherry picked from commit 64962e4f0e)
2021-07-02 21:46:40 +05:30
Naman JainandGitHub 32e58a6106 chore: update changelog for v3.2103 (#1711) 2021-06-03 11:47:49 +05:30
Naman JainandGitHub 2a50389a00 chore(superflag): remove special handling of the flags #1689 2021-04-05 23:40:11 +05:30
Naman JainandGitHub d009901d63 feat(options): allow special handling and checking when creating options from superflag (#1688)
We provide few special options along with badger options.

// Special Handling: compression, cache-mb, cache-percentage sub-flags.
// Valid values for special flags:
// compression: valid options are {none,snappy,zstd:<level>}
// cache-mb: uint
// cache-percentage: 2 comma-separated values summing upto 100. Format: blockCache,indexCache
// goroutines: alias for numgoroutines.
// Example: compression=zstd:3; cache-mb=2048; cache-percentage=70,30; goroutines=8;
2021-04-05 18:48:09 +05:30
Naman JainandGitHub 458a5fa257 chore(logging): consistently use humanize ibytes (#1685) 2021-03-30 19:26:44 +05:30
Naman JainandGitHub 5644917ba5 fix(merge-operator): don't read the deleted keys (#1675) 2021-03-03 13:41:05 +05:30
Naman JainandGitHub 90d0cc460c fix(discard): close the discard stats file on db close #1672
In windows, an unclosed file cannot be removed. This causes the failure of os.RemoveAll().
2021-02-24 18:20:28 +05:30
Naman JainandGitHub 9d859c8709 fix(iterator): fix iterator when data does not exist in read only mode #1670
Prevent iterator crashing the DB in case the data does not exist in read-only mode.
2021-02-22 21:29:19 +05:30
Naman JainandGitHub 1d9161103c chore: use gogofaster instead of gofast (#1639)
Switch to gogofaster as it does not produce the extra XXX_ fields that increase up the space of protobuf.
2021-01-25 14:58:49 +05:30
Naman JainandGitHub 5b1dc0bafb feat: add functionality to ban a prefix (#1638)
Adds functionality to ban a namespace so that no read/write is allowed to a key belonging 
to any of the banned namespaces:

- Add BanNamespcae() and BannedNamespace() API.
- Set(), Get() operations on the keys belonging to any of these banned namespaces is denied.
- The iterator will skip these namespaces.
- The keys for these banned namespaces will be dropped at the time of compaction as the 
   iterator will not even pick them.

For details: check PR #1638
2021-01-25 14:57:29 +05:30
Naman JainandGitHub 2d60e3c09b fix: update ristretto and use filepath (#1649)
* update ristretto
* use filepath instead of path
2021-01-22 14:04:29 +05:30
Naman JainandGitHub aea85141c8 chore(info): add checksum verification mode flag to badger info (#1644)
This PR adds a checksum verification mode (--cv-mode) flag to badger info tool.
2021-01-18 17:22:30 +05:30
Naman JainandGitHub 6add7b479f chore: remove unused argument and obsolete FileLoadingMode option (#1640)
Removes unused argument and obsolete FileLoadingMode option.
2021-01-14 11:31:03 +05:30
Naman JainandGitHub 61ea3130e1 chore(stream): log the estimated size of data to be streamed (#1632)
When you're scanning a lot, but sending little data, the stream framework seems to work really slowly. But, that's deceiving, because it is scanning really fast.
We calculate the rough uncompressed size of the data the stream framework will send. We also periodically log the amount of data scanned by produceKVs.
2021-01-07 18:48:00 +05:30
Naman JainandGitHub 065bc7e0f2 debug(tableIndex): add debug info for initIndex (#1626)
This PR adds debug information for the crash in `initIndex`. We suspect that it may be due to unsynced mmap (#1625), or because of mishandling of SST files.
2021-01-05 11:29:05 +05:30
Naman JainandGitHub 63fbb1bf4c fix(build): fix 32-bit build (#1627) 2021-01-04 16:19:13 +05:30
Naman JainandGitHub 5d8aa51ead fix(table): always sync SST to disk (#1625)
SST files were not sync'ed to disk by default. Machine crash may happen before the explicit sync (which happens at DB close), leading to an inconsistent state and badger not able to open. It is better to explicitly do a sync.
2020-12-23 13:44:11 +05:30
Naman JainandGitHub 47e6407800 fix(dropPrefix): check properly if the key is present in a table (#1623)
There may be a case when the table contains [0x0000,...., 0xffff]. If we are searching for k=0x0011, we should not directly infer that k is present. It may not be present. This leads to the triggering of compaction at the time of DropPrefix which is quite expensive.

This PR fixes the issue by confirming that case by searching inside the table for the prefix.
2020-12-21 17:35:36 +05:30
Naman JainandGitHub 96afcea1a3 opt(DropPrefix): check if there exist some data to drop before dropping prefixes (#1621)
We currently do not check if there exist some data to drop for prefixes in DropPrefix(). This can make drop prefix to be expensive because it has to do a bunch of compactions, etc.

This PR optimizes that behavior by not doing any of that in case no data exist for prefixes.
2020-12-17 19:54:58 +05:30
Naman JainandGitHub 80b6d08972 fix(tableBuilding): reduce scope of valuePointer (#1617) 2020-12-08 22:50:32 +05:30
3948c242e6 fix(compaction): fix table size estimation on compaction (#1613)
If a table has a mixture of value log pointers and embedded values,
badger will carry over the last length from a value log entry into
the subsequent embedded entries.

Co-authored-by: Raúl Kripalani <raul@protocol.ai>
2020-12-07 13:39:14 +05:30
Naman JainandGitHub f3cdccd935 fix(readonly): fix the file opening mode (#1592) 2020-11-12 14:04:17 +05:30
Naman JainandGitHub 2ff936a90b fix(stream): double free from stream writer (#1588)
The allocators created via produceKVs() are freed in Orchestrate itself. So we need not free them from streamsKVs().
2020-11-06 19:30:54 +05:30
Naman JainandGitHub c4671ad32b fix(read-only):add checks when db is opened in read-only mode (#1565)
When db is opened in read-only mode, we should not create/truncate memtables or wal files.
2020-11-03 14:03:52 +05:30
Naman JainandGitHub e1794fc6e0 chore(vlog): remove replay closer while opening vlog (#1568) 2020-10-16 14:36:59 +05:30
Naman JainandGitHub 02b6edbbdb test(wal): add test for stream-writer with jemalloc enabled and discard stats (#1557) 2020-10-15 14:54:37 +05:30
Naman JainandGitHub 45be185bc2 add IndexSz field to TableInfo, to show it through badger info tool
This PR adds the table index size to badger info and adds a new field IndexSz to TableInfo struct. This field denotes the size of the table index
2020-08-24 12:43:58 +05:30
Naman JainandGitHub f8fb05e9ee use badger defaults in write benchmark tool (#1448)
use badger defaults in write benchmark tool and add flag for syncWrites
2020-07-29 19:11:38 +05:30
Naman JainandGitHub 3fa1b3115d update function description for DB.Backup() and Stream.Backup() (#1443)
1. Addresses #1351 (https://discuss.dgraph.io/t/db-backup-stream-backup-may-duplicate-entries-in-incremental-backups-if-used-naively/8738)
2. Closes Dgraph-2085.
Updates the description of Backup() to show that the user needs to increment the return value to pass to the later invocation to create an incremental backup. Also, copies the description from Stream.Backup() -> DB.Backup().
2020-07-22 21:12:15 +05:30
Naman JainandGitHub d5ba8e6f02 add dropall periodically option to write benchmark (#1433)
This PR adds drop all option to write benchmark.
This shows some issues when run on my PC.
Specs:
OS: Ubuntu 18.04
RAM: 8GB
Processor: i5
2020-07-17 10:30:37 +05:30
Naman JainandGitHub 769c73cd7f add GC flags for write benchmark (#1426)
This PR adds GC flags to badger write benchmark.
(--gc-every and --gc-ratio flags)
2020-07-16 18:06:42 +05:30
Naman JainandGitHub e43a33c62b add more flags to write benchmark (#1423)
This PR adds flags to write test benchmark corresponding to the flags in worker/server_state.go.
2020-07-14 16:54:25 +05:30
Aman MangalandGitHub 2b307b8c73 Regenerate proto files (#954) 2019-08-01 09:20:20 -07:00
Aman Mangal a9dd24bc09 Add interface Cache to ristretto package 2019-03-08 11:26:50 +05:30