Benjamin Wang
c12e15d91a
Add verification on keys: should be always mononically increasing
...
Signed-off-by: Benjamin Wang <benjamin.ahrtr@gmail.com>
2024-01-25 18:00:26 +00:00
Siyuan Zhang
30b242f800
Revert "add test cases of duplicate keys in one tx."
...
This reverts commit 8d29b245a39172bd72643106ea7d9e4df727bd7e.
Signed-off-by: Siyuan Zhang <sizhang@google.com>
2024-01-19 08:58:48 -08:00
Siyuan Zhang
93afd8e430
Revert "add key dedupe when a write buffer writeback to an empty read buffer bucket."
...
This reverts commit 971a4f57ccff71dfc10c1f9eb7a6a4d64bec1d2e.
Signed-off-by: Siyuan Zhang <sizhang@google.com>
2024-01-19 08:58:27 -08:00
Benjamin Wang
690916f018
replace CreateBucket with CreateBucketIfNotExists
...
Signed-off-by: Benjamin Wang <benjamin.ahrtr@gmail.com>
2024-01-16 09:40:20 +00:00
Benjamin Wang
9ded10ec76
Merge pull request #17237 from ahrtr/bbolt_logger_20240112
...
Specify logger for bbolt
2024-01-13 11:03:14 +00:00
Benjamin Wang
cfbf672b3c
specify logger for bbolt
...
Signed-off-by: Benjamin Wang <benjamin.ahrtr@gmail.com>
2024-01-12 16:38:18 +00:00
Siyuan Zhang
971a4f57cc
add key dedupe when a write buffer writeback to an empty read buffer bucket.
...
Signed-off-by: Siyuan Zhang <sizhang@google.com>
2024-01-11 11:31:09 -08:00
Siyuan Zhang
8d29b245a3
add test cases of duplicate keys in one tx.
...
Signed-off-by: Siyuan Zhang <sizhang@google.com>
2024-01-11 11:31:03 -08:00
Siyuan Zhang
db61c9695d
commit bbolt transaction if there is any pending deleting operations
...
Signed-off-by: Siyuan Zhang <sizhang@google.com>
2024-01-10 09:33:21 -08:00
Siyuan Zhang
b3a5307640
add tests to test tx delete consistency.
...
Signed-off-by: Siyuan Zhang <sizhang@google.com>
2024-01-10 09:33:13 -08:00
Wei Fu
aa97484166
*: enable goimports in verify-lint
...
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-09-21 21:14:09 +08:00
chenyahui
c0aa3b613b
Use any instead of interface{}
...
Signed-off-by: chenyahui <cyhone@qq.com>
2023-09-17 17:41:58 +08:00
new-dream
b05d75ab0b
server: optimizing memory overhead of copy operation in ConcurrentReadTxn
...
Signed-off-by: new-dream <111836360+new-dream@users.noreply.github.com>
2023-08-30 23:03:15 +08:00
Marek Siarkowicz
53cbd81009
Separate Writer interface from BatchTx interfaces
...
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-07-31 10:18:01 +02:00
Marek Siarkowicz
29769984e6
Remove RLock/RUnlock from BatchTx
...
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-07-28 11:39:50 +02:00
Marek Siarkowicz
b4f8a7be51
server: Remove Lock/Unlock from ReadTx
...
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-07-27 13:34:43 +02:00
caojiamingalan
bc97a94564
Follow up https://github.com/etcd-io/etcd/pull/16068#discussion_r1263664700
...
Replace unnecessary Lock()/Unlock()s with RLock()/RUnlock()s
Signed-off-by: caojiamingalan <alan.c.19971111@gmail.com>
2023-07-14 20:08:25 -05:00
Piotr Tabor
6f899a7b40
Merge pull request #15052 from ptabor/20221228-goimports-fix
...
./scripts/fix.sh: Takes care of goimports across the whole project.
2022-12-29 11:31:22 +01:00
Piotr Tabor
9e1abbab6e
Fix goimports in all existing files. Execution of ./scripts/fix.sh
...
Signed-off-by: Piotr Tabor <ptab@google.com>
2022-12-29 09:41:31 +01:00
Wei Fu
4d0b91947e
chore: delete // +build buildtag by go fix
...
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2022-12-29 14:17:05 +08:00
Andrew Sims
f656fa0f49
add missing copyright headers
...
Signed-off-by: Andrew Sims <andrew.cameron.sims@gmail.com>
2022-11-23 19:13:43 +11:00
Benjamin Wang
4f824336ad
etcdserver: add two failpoints for backend
...
1. before and after create boltDB transaction;
2. before and after writebuf back to read buffer;
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-15 08:09:05 +08:00
Benjamin Wang
3f18816e7d
etcdserver: add gofail points before and after OnPreCommitUnsafe
...
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-14 11:02:18 +08:00
Benjamin Wang
5a3ef953eb
etcdserver: call the OnPreCommitUnsafe in unsafeCommit
...
`unsafeCommit` is called by both `(*batchTxBuffered) commit` and
`(*backend) defrag`. When users perform the defragmentation
operation, etcd doesn't update the consistent index. If etcd
crashes(e.g. panicking) in the process for whatever reason, then
etcd replays the WAL entries starting from the latest snapshot,
accordingly it may re-apply entries which might have already been
applied, eventually the revision isn't consistent with other members.
Refer to discussion in https://github.com/etcd-io/etcd/pull/14685
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-11 10:57:15 +08:00
Piotr Tabor
d69e07dd3a
Verification framework and check whether cindex is not decreasing.
2022-04-22 12:32:05 +02:00
ahrtr
4033f5c2b9
move the consistentIdx and consistentTerm from Etcdserver to cindex package
...
Removed the fields consistentIdx and consistentTerm from struct EtcdServer,
and added applyingIndex and applyingTerm into struct consistentIndex in
package cindex. We may remove the two fields completely if we decide to
remove the OnPreCommitUnsafe, and it will depend on the performance test
result.
2022-04-07 15:16:49 +08:00
ahrtr
e155e50886
rename LockWithoutHook to LockOutsideApply and add LockInsideApply
2022-04-07 05:35:13 +08:00
ahrtr
a4c5da844d
added detailed comment to explain the difference between Lock and LockWithoutHook
2022-04-07 05:35:13 +08:00
ahrtr
bfd5170f66
add a txPostLockHook into the backend
...
Previously the SetConsistentIndex() is called during the apply workflow,
but it's outside the db transaction. If a commit happens between SetConsistentIndex
and the following apply workflow, and etcd crashes for whatever reason right
after the commit, then etcd commits an incomplete transaction to db.
Eventually etcd runs into the data inconsistency issue.
In this commit, we move the SetConsistentIndex into a txPostLockHook, so
it will be executed inside the transaction lock.
2022-04-07 05:35:13 +08:00
Marek Siarkowicz
ad03f2076a
Merge pull request #13886 from serathius/backend-logger
...
tests: Pass logger to backend
2022-04-05 16:35:07 +02:00
Marek Siarkowicz
73fc864247
tests: Pass logger to backend
2022-04-05 15:53:38 +02:00
Marek Siarkowicz
1d3517020b
server: Add verification of whether lock was called within out outside of apply
2022-04-05 15:34:45 +02:00
ahrtr
836bd6bc3a
fix WARNING: DATA RACE issue when multiple goroutines access the backend concurrently
2022-04-03 06:13:09 +08:00
Bogdan Kanivets
01347a8f53
server/storage/backend: restore original bolt db options after defrag
...
Problem: Defrag was implemented before custom bolt options were added.
Currently defrag doesn't restore backend options.
For example BackendFreelistType will be unset after defrag.
Solution: save bolt db options and use them in defrag.
2022-02-11 11:01:27 -08:00
Linhai
3ebd0a7d00
fixing the goroutine leak in TestBackendClose
2021-12-15 01:54:51 -05:00
Eng Zer Jun
2a151c8982
*: move from io/ioutil to io and os packages
...
The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil . This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2021-10-28 00:05:28 +08:00
Geeta Gharpure
817d2f40d1
storage/backend: Add a gauge to indicate if defrag is active
2021-09-27 17:02:13 -07:00
Marek Siarkowicz
5b6f4579fb
server: Rename buckets to schema
2021-07-12 15:37:21 +02:00
Marek Siarkowicz
5e40a8b00c
server: Create storage package and move mvcc files to it
2021-07-12 15:37:21 +02:00