1
0
Fork 0
mirror of https://github.com/dragonflydb/dragonfly.git synced 2024-12-14 11:58:02 +00:00
Commit graph

403 commits

Author SHA1 Message Date
Roman Gershman
54444bf6ca chore(json): low level parsing function
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2022-08-26 16:50:10 +03:00
Roman Gershman
985188c8ad chore(json): Add more unit tests.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2022-08-26 16:50:10 +03:00
Roman Gershman
ad6e904a53 Add jsoncons library as third-party dependency 2022-08-26 16:50:10 +03:00
Roman Gershman
4e4ed63467
feat(server): tighten memory checks when inseting a new object. (#258)
Before this change Dragonfly evicted items only when it was low on memory and had to grow its main dictionary.
It is not enough because in many cases Dragonfly can grow in memory even when the main dictionary does not grow.
For example, when its dictionary is less than 90% utilized, but the newly added objects require lots of memory.

In addition, the dashtable adds additional segments, when other segments have enough available slots to fill the rest of the free memory.

This change adds another layer of defense that allows evicting items even when dictionary segments are not full.
The eviction is still local with respect to a segment. On my tests it seems that it's much harder to cross maxmemory limit than before.

In addition, we tightened the heuristic that allowes the dashtable to grow. Now it takes into account the average bytes per item
in order to project how much memory the full table takes before adding to it new segments.
This really improves dashtable utilization.

There are still things to improve:
1. the eviction behavior is rough. Once an insert does the eviction it tries to free enough objects to bring memory back.
   This may result in very spiky insertion/eviction patterns.
2. The eviction procedure, even though it's limited to a single segment, is quite heavy because it goes over all buckets
   in the segment. This may result in weird artifacts where we evict just enough to be under the limit, then add and evict
   again and so on.
3. Therefore, we may need a periodic eviction that will compliment this emergency eviction step.

Fixes #224 and partially addresses #256

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2022-08-26 15:00:08 +03:00
Braydn
b7f85e59a6
feat(server): Implemented periodic snapshotting (#161) (#250)
* feat(server): Implemented periodic snapshotting (#161)

* feat(test): Added the ability to specify dragonfly cli parameters on a test basis (#199)

Signed-off-by: Braydn <braydn.moore@uwaterloo.ca>

* feat(server): Implemented periodic snapshotting (#161)

Code cleanup & CONTRIBUTORS.md modifcation

Signed-off-by: Braydn <braydn.moore@uwaterloo.ca>

* feat(server): Implemented periodic snapshotting (#161)

Parsing and race condition fixes. Improved pytests

Signed-off-by: Braydn <braydn.moore@uwaterloo.ca>

* feat(test): Cleaned up pytest code & added documentation (#199)

- Moved tests into their own file
- Renamed test namespace to avoid naming conflicts with pytest
- Updated requirements.txt to make test environment reproducible
- Added documentation to write tests

feat(server): Updated helio submodule

Signed-off-by: Braydn <braydn.moore@uwaterloo.ca>

Signed-off-by: Braydn <braydn.moore@uwaterloo.ca>
Co-authored-by: Braydn <braydnmoore3@gmail.com>
2022-08-26 13:54:38 +03:00
Roman Gershman
c49e88899b docs(server): Start DF shared nothing design document. 2022-08-20 21:38:33 +03:00
Vladislav
25e700f39f
feat(server): Implement STICK command #219 (#245)
* feat(server): Implement STICK command #219

Signed-off-by: Vladislav Oleshko <vladislav.oleshko@gmail.com>
2022-08-20 16:50:43 +03:00
Roman Gershman
77bb34fab5
feat(monitoring): Add docker-compose for local monitoring dashboard. (#246)
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2022-08-20 11:06:11 +03:00
Roman Gershman
7d2298b95a fix(server): Fix unrelevant error message when using UDS.
Also fixes #248.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2022-08-19 15:26:19 +03:00
odedponcz
08cda413f7
Move assets to static (#247)
Signed-off-by: Oded Poncz <oded@poncz.com>

Signed-off-by: Oded Poncz <oded@poncz.com>
2022-08-18 22:55:12 +03:00
odedponcz
3d3d395e25
fix:change statis assets url for http monitoring page (#243)
* fix:change statis assets url for http monitoring page

Signed-off-by: Oded Poncz <oded@poncz.com>

* fix:change statis assets url for http monitoring page

Signed-off-by: Oded Poncz <oded@poncz.com>

* fix:change statis assets url for http monitoring page

Signed-off-by: Oded Poncz <oded@poncz.com>

Signed-off-by: Oded Poncz <oded@poncz.com>
2022-08-17 15:06:22 +03:00
Roman Gershman
4054297bbd fix(rdb): add error msg when rejecting the rdb version. 2022-08-15 09:12:14 +03:00
Roman Gershman
9f935a33c0 fix(doc): add more examples on how to run node-redis test image 2022-08-15 08:37:28 +03:00
odedponcz
f31d452939
docs: Update README.md twitter handle (#242)
Update README.md
2022-08-15 08:15:53 +03:00
odedponcz
cf729f3fcb
feat(test): Add integration test for the jedis and node-redis clients (#233)
* docs: Improve wording in issue reporting

Signed-off-by: odedponcz <oded@poncz.com>

* docs: Change contribution doc flow

Signed-off-by: odedponcz <oded@poncz.com>

* feat(tests): Add integration test with node-redis

Signed-off-by: odedponcz <oded@poncz.com>

* Rename integration test docker files

Signed-off-by: odedponcz <oded@poncz.com>
2022-08-12 22:42:54 +03:00
odedponcz
a00c205b5b
docs: Improve wording in issue reporting (#232)
* docs: Improve wording in issue reporting

Signed-off-by: odedponcz <oded@poncz.com>

* docs: Change contribution doc flow

Signed-off-by: odedponcz <oded@poncz.com>
2022-08-08 10:55:44 +03:00
odedponcz
3b04801cd6
fix: RENAMENX according to spec #229 (#230)
fix: RENAMENX according to spec #226

Signed-off-by: odedponcz <oded@poncz.com>
2022-08-07 22:49:21 +03:00
Roman Gershman
d19fa58216 feat(server): support unix sockets.
Resolves #206. There some minor fixes left to do, but they demand improvements in helio:

1. Remove spurious socket configuration calls that fail on uds.
2. Remove incorrect port printing for uds listener (listener_interface.cc:79).

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2022-08-02 14:41:18 +03:00
Roman Gershman
cf991deb03 chore(server): add updateval_amount statistic.
This statistic helps understanding how much Dragonfly memory grows via updating the existing value vs the new ones.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2022-08-02 11:03:46 +03:00
romange
404629258a chore(helm-chart): update to v0.6.0 2022-07-29 05:53:30 +00:00
Roman Gershman
e8cbd41719 fix(build): Fixes #220. 2022-07-28 10:13:48 +03:00
Ikko Ashimine
4ab55675bb docs(README): minor fix
Github -> GitHub
2022-07-27 23:42:26 +03:00
Roman Gershman
b07415ebb8
fix(server): add gitsha to version output. (#217)
This closes #202.
In addition, update helio dependency.
2022-07-27 10:51:18 +03:00
iko1
753c1c0177 feat(server): add pidfile parameter (#209)
Signed-off-by: iko1 <me@remotecpp.dev>
2022-07-27 09:46:28 +03:00
Roman Gershman
f7e58f4de2 fix(pytest): Minor fixes 2022-07-26 17:31:39 +03:00
Roman Gershman
a00d45fb43 fix(bench): Improvements to dash_bench
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2022-07-20 07:05:13 +03:00
Roman Gershman
3bbdb8e4b1
feat(journal): Introduce basic journal support. (#211)
1. No entries data is written into a journal yet.
2. Introduced a state machine to start and stop journal using a new auxillary command "dfly".
3. string_family currently calls an universal command Journal::RecordEntry that should
   save the current key/value of that entry. Please note that we won't use it for all the operations
   because for some it's more efficient to record the action itself than the final value.
4. no locking information is recorded yet so atomicity of multi-key operations is not preserved for now.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2022-07-17 21:12:50 +03:00
Roman Gershman
05eb323a0d
fix(server): Fix #207 (#208)
1. Erase expiry data from the expire table in case of evictions.
2. Add test that covers the bug.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2022-07-15 15:14:20 +03:00
Shmulik Klein
d2b7987ac3
test: flush all records between pytest tests #199 (#205)
test: flush all records between pytest tests
2022-07-13 12:45:29 +03:00
odedponcz
d29425fb2e
feat: Print out dragonfly version and build on startup #202 (#203)
* feat: Print out dragonfly version and build on startup #202

* feat: Print out dragonfly version and build on startup #202
changes after review.
2022-07-12 17:49:27 +03:00
Shmulik Klein
1f2895e991
[WIP] test: add dragonfly_db fixture to python tests #199 (#204)
* test: add dragonfly_db fixture to it tests #199

Signed-off-by: Shmulik Klein <shmulik.klein@gmail.com>

* test: lint using flake8

Signed-off-by: Shmulik Klein <shmulik.klein@gmail.com>

* test: run dragonfly debug version as fallback

Signed-off-by: Shmulik Klein <shmulik.klein@gmail.com>
2022-07-12 17:43:46 +03:00
Joseph Bylund
1cba08891e
docs(README): Document hz flag (#201)
Document hz flag in readme

The hz flag determines how frequently timers used for key eviction are evaluated. Document this flag in the readme.
2022-07-12 13:37:36 +03:00
iko1
7adf80fccd
fix(server): setup sigill handler (#183) (#198)
Signed-off-by: iko1 <me@remotecpp.dev>
2022-07-09 22:36:05 +03:00
iko1
2b0869c16d
fix(server): exit gracefully when iouring not supported (#197)
fix(server): exit gracefully when iouring not supported #181

Signed-off-by: iko1 <me@remotecpp.dev>
2022-07-09 18:44:23 +03:00
Roman Gershman
9e36197742
chore(server): improve error logging if info command fails. (#196)
Related to #195.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2022-07-09 09:17:42 +03:00
Rom Grk
1c81bfa66c
doc(quick-start): add note for known issues (#194)
doc: update quick-start
2022-07-08 11:25:24 +03:00
Roman Gershman
c5c143525c chore(presubmit): add more useful hooks 2022-07-08 10:23:46 +03:00
Roman Gershman
049f34c89f
chore(rdb): Move object creation during load operation to shard threads. (#193)
This commit fixes the behavior with streams loading and resolves #159.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2022-07-07 13:39:59 +03:00
Roman Gershman
567af06d2c
fix(action): switch git push to dedicated action (#192)
Docker release pipeline can not push to protected main branch using
the service token. This switches to PAT secret.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2022-07-06 12:55:10 +03:00
romange
080203ec21 chore(helm-chart): update to v0.4.0 2022-07-05 18:28:37 +00:00
Roman Gershman
c174b3bead
chore(pubsub): update api status (#189)
chore(pubsub): update api status.

Also make subcommand matching for pubsub case insensitive.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2022-07-04 20:15:27 +03:00
Roman Gershman
55389d9be5
chore(rdb): move object creation during loading to shard threads. (#188)
Related to #159. Before this change, rdb loading thread has been creating all the redis objects as well.
Now we separate rdb file parsing and objects creation. File parsing phase produces a load trace of one or more binary blobs.
Those blobs are then passed to the threads that are responsible to manage the objects.
The second phase is object creation based on the trace that was passed. Finally those binary blobs are destroyed.
As a result, each thread creates objects using the memory allocator it owns and memory stats become consistent.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2022-07-04 19:08:13 +03:00
Roman Gershman
8cb486a690
chore(dash): add dashtable benchmark. (#187)
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2022-07-04 16:01:19 +03:00
Zacharya
25becd2d43
feat(pubsub): implement pubsub command close #90 (#175)
* feat(pubsub): implement pubsub command

* fix(pubsub): code review

* fix(pubsub): code review

* fix(pubsub): code review
2022-07-04 15:57:00 +03:00
Roman Gershman
c8fe7ba28b fix(server): Fix serialization logic when returning an empty array.
1. Fix SendStringArr logic. Consolidate both string_view and string variants to using the same code.
2. Tighten the test framework so that it will test that the parser consumed the whole response.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2022-06-28 19:51:25 +03:00
Roman Gershman
448d065647
fix(server): Fix a crash when running "client list" command. (#179)
Also, enhance release script to apply linker optimizations when building the binaries.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2022-06-26 17:25:42 +03:00
Roman Gershman
605b1fd217
chore(server): Improve the implementation of SendStringArr. (#178)
1. Make it use vectorized send instead of concatenating everything into a single string.
2. vectorized SendStringArr could fail sending large arrays for lengths higher than 512 (returned EMSGSIZE).
   We improved the implementation so it would send those arrays in chunks of 256 items.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2022-06-26 06:12:53 +03:00
Ryan Russell
1f42926b7b
docs(docker-compose): Explain NAT overhead in docker-compose (#176)
docs(docker-compose): Explain `NAT` overhead in docker-compose overlay vs host networks

Signed-off-by: Ryan Russell <git@ryanrussell.org>
2022-06-25 21:47:31 +03:00
Luca Goslar
1ba767dc97
fix(docker-compose): Fetch actual Docker Compose file and add memlock conf to service (#173)
docs(docker-compose): Fetch actual Docker Compose file
fix(docker-compose): Add memlock conf to service

Signed-off-by: Luca Goslar <47827429+lucagoslar@users.noreply.github.com>
2022-06-23 18:37:17 +03:00
Philipp B
7446b85bb3
feat(actions): bump helm-chart version when new container image is published (#162)
Signed-off-by: Philipp Born <mail@philipp-born.eu>
2022-06-20 20:25:14 +03:00