-
Notifications
You must be signed in to change notification settings - Fork 2
Add MVCC support and integrate HLC timestamps #281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5a87cc9
Add MVCC support and integrate HLC timestamps
bootjp c78fd1e
Merge branch 'main' into feature/fix-create-node
bootjp 932cfa0
Refactor txn entry merging logic in mvcc store
bootjp 433db20
Merge branch 'feature/fix-create-node' of github.com:bootjp/elastickv…
bootjp 01aac5b
Refactor txn timestamp assignment logic
bootjp 5e83da6
Update store/mvcc_store.go
bootjp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # Repository Guidelines | ||
|
|
||
| ## Project Structure & Modules | ||
| - `cmd/server`, `cmd/client`: entrypoints for running the KV server and client. | ||
| - `store/`: MVCC storage engine, OCC/TTL, and related tests. | ||
| - `kv/`: hybrid logical clock (HLC) utilities and KV interfaces. | ||
| - `adapter/`: protocol adapters (e.g., Redis), plus integration tests. | ||
| - `jepsen/`, `jepsen/redis/`: Jepsen test harnesses and workloads. | ||
| - `proto/`, `distribution/`, `internal/`: supporting protobufs, build assets, and shared helpers. | ||
|
|
||
| ## Build, Test, and Development Commands | ||
| - `go test ./...` — run unit/integration tests. If macOS sandbox blocks `$GOCACHE`, prefer `GOCACHE=$(pwd)/.cache GOTMPDIR=$(pwd)/.cache/tmp go test ./...`. | ||
| - `GOCACHE=$(pwd)/.cache GOLANGCI_LINT_CACHE=$(pwd)/.golangci-cache golangci-lint run ./... --timeout=5m` — full lint suite. | ||
| - `HOME=$(pwd)/jepsen/tmp-home LEIN_HOME=$(pwd)/jepsen/.lein LEIN_JVM_OPTS="-Duser.home=$(pwd)/jepsen/tmp-home" /tmp/lein test` (from `jepsen/` or `jepsen/redis/`) — Jepsen tests. | ||
| - `go run ./cmd/server` / `go run ./cmd/client` — start server or CLI locally. | ||
|
|
||
| ## Coding Style & Naming | ||
| - Go code: `gofmt` + project lint rules (`golangci-lint`). Avoid adding `//nolint` unless absolutely required; prefer refactoring. | ||
| - Naming: Go conventions (MixedCaps for exported identifiers, short receiver names). Filenames remain lowercase with underscores only where existing. | ||
| - Logging: use `slog` where present; maintain structured keys (`key`, `commit_ts`, etc.). | ||
|
|
||
| ## Testing Guidelines | ||
| - Unit tests co-located with packages (`*_test.go`); prefer table-driven cases. | ||
| - TTL/HLC behaviors live in `store/` and `kv/`; add coverage when touching clocks, OCC, or replication logic. | ||
| - Integration: run Jepsen suites after changes affecting replication, MVCC, or Redis adapter. | ||
| - `cd jepsen && HOME=$(pwd)/tmp-home LEIN_HOME=$(pwd)/.lein LEIN_JVM_OPTS="-Duser.home=$(pwd)/tmp-home" /tmp/lein test` | ||
| - `cd jepsen/redis && HOME=$(pwd)/../tmp-home LEIN_HOME=$(pwd)/../.lein LEIN_JVM_OPTS="-Duser.home=$(pwd)/../tmp-home" /tmp/lein test` | ||
|
|
||
| ## Commit & Pull Request Guidelines | ||
| - Messages: short imperative summary (e.g., “Add HLC TTL handling”). Include scope when helpful (`store:`, `adapter:`). | ||
| - Pull requests: describe behavior change, risk, and test evidence (`go test`, lint, Jepsen). Add repro steps for bug fixes. | ||
|
|
||
| ## Security & Configuration Tips | ||
| - Hybrid clock derives from wall-clock millis; keep system clock reasonably synchronized across nodes. | ||
| - Avoid leader-local timestamps in persistence; timestamp issuance should originate from the Raft leader to prevent skewed OCC decisions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.