mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 10:25:47 +02:00
docs(server): readability cleanup (#304)
* docs: fix Daniel Lemire's name Signed-off-by: Ryan Russell <git@ryanrussell.org> * refactor(server): readability cleanup Signed-off-by: Ryan Russell <git@ryanrussell.org> * docs: actually fix the name attribution Signed-off-by: Ryan Russell <git@ryanrussell.org> Signed-off-by: Ryan Russell <git@ryanrussell.org>
This commit is contained in:
parent
7cc761134b
commit
b81634c25f
9 changed files with 11 additions and 11 deletions
|
@ -152,7 +152,7 @@ inline void FreeObjStream(void* ptr) {
|
||||||
freeStream((stream*)ptr);
|
freeStream((stream*)ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deniel's Lemire function validate_ascii_fast() - under Apache/MIT license.
|
// Daniel Lemire's function validate_ascii_fast() - under Apache/MIT license.
|
||||||
// See https://github.com/lemire/fastvalidate-utf-8/
|
// See https://github.com/lemire/fastvalidate-utf-8/
|
||||||
// The function returns true (1) if all chars passed in src are
|
// The function returns true (1) if all chars passed in src are
|
||||||
// 7-bit values (0x00..0x7F). Otherwise, it returns false (0).
|
// 7-bit values (0x00..0x7F). Otherwise, it returns false (0).
|
||||||
|
|
|
@ -56,7 +56,7 @@ void ConnectionContext::ChangeSubscription(bool to_add, bool to_reply, CmdArgLis
|
||||||
unsigned prev = shard_idx[0];
|
unsigned prev = shard_idx[0];
|
||||||
shard_idx[0] = 0;
|
shard_idx[0] = 0;
|
||||||
|
|
||||||
// compute cumulitive sum, or in other words a beginning index in channels for each shard.
|
// compute cumulative sum, or in other words a beginning index in channels for each shard.
|
||||||
for (size_t i = 1; i < shard_idx.size(); ++i) {
|
for (size_t i = 1; i < shard_idx.size(); ++i) {
|
||||||
unsigned cur = shard_idx[i];
|
unsigned cur = shard_idx[i];
|
||||||
shard_idx[i] = shard_idx[i - 1] + prev;
|
shard_idx[i] = shard_idx[i - 1] + prev;
|
||||||
|
|
|
@ -180,7 +180,7 @@ TEST_F(GenericFamilyTest, Stick) {
|
||||||
ASSERT_THAT(Run({"stick", "b", "d"}), IntArg(1));
|
ASSERT_THAT(Run({"stick", "b", "d"}), IntArg(1));
|
||||||
ASSERT_THAT(Run({"stick", "c", "d"}), IntArg(0));
|
ASSERT_THAT(Run({"stick", "c", "d"}), IntArg(0));
|
||||||
|
|
||||||
// check stickyness presists during writes
|
// check stickyness persists during writes
|
||||||
Run({"set", "a", "new"});
|
Run({"set", "a", "new"});
|
||||||
ASSERT_THAT(Run({"stick", "a"}), IntArg(0));
|
ASSERT_THAT(Run({"stick", "a"}), IntArg(0));
|
||||||
Run({"append", "a", "-value"});
|
Run({"append", "a", "-value"});
|
||||||
|
@ -190,7 +190,7 @@ TEST_F(GenericFamilyTest, Stick) {
|
||||||
Run({"rename", "a", "k"});
|
Run({"rename", "a", "k"});
|
||||||
ASSERT_THAT(Run({"stick", "k"}), IntArg(0));
|
ASSERT_THAT(Run({"stick", "k"}), IntArg(0));
|
||||||
|
|
||||||
// check rename perists stickyness on multiple shards
|
// check rename persists stickyness on multiple shards
|
||||||
Run({"del", "b"});
|
Run({"del", "b"});
|
||||||
string b_val(32, 'b');
|
string b_val(32, 'b');
|
||||||
string x_val(32, 'x');
|
string x_val(32, 'x');
|
||||||
|
|
|
@ -71,7 +71,7 @@ std::error_code JournalShard::Open(const std::string_view dir, unsigned index) {
|
||||||
// For file integrity guidelines see:
|
// For file integrity guidelines see:
|
||||||
// https://lwn.net/Articles/457667/
|
// https://lwn.net/Articles/457667/
|
||||||
// https://www.evanjones.ca/durability-filesystem.html
|
// https://www.evanjones.ca/durability-filesystem.html
|
||||||
// NOTE: O_DSYNC is omited.
|
// NOTE: O_DSYNC is omitted.
|
||||||
constexpr auto kJournalFlags = O_CLOEXEC | O_CREAT | O_TRUNC | O_RDWR;
|
constexpr auto kJournalFlags = O_CLOEXEC | O_CREAT | O_TRUNC | O_RDWR;
|
||||||
io::Result<std::unique_ptr<uring::LinuxFile>> res =
|
io::Result<std::unique_ptr<uring::LinuxFile>> res =
|
||||||
uring::OpenLinux(shard_path_, kJournalFlags, 0666);
|
uring::OpenLinux(shard_path_, kJournalFlags, 0666);
|
||||||
|
|
|
@ -271,7 +271,7 @@ OpResult<vector<OptBool>> OpToggle(const OpArgs& op_args, string_view key, strin
|
||||||
json j = result.value();
|
json j = result.value();
|
||||||
error_code ec = JsonReplace(j, path, cb);
|
error_code ec = JsonReplace(j, path, cb);
|
||||||
if (ec) {
|
if (ec) {
|
||||||
VLOG(1) << "Failed to evaulate expression on json with error: " << ec.message();
|
VLOG(1) << "Failed to evaluate expression on json with error: " << ec.message();
|
||||||
return OpStatus::SYNTAX_ERR;
|
return OpStatus::SYNTAX_ERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -314,7 +314,7 @@ OpResult<string> OpDoubleArithmetic(const OpArgs& op_args, string_view key, stri
|
||||||
json j = result.value();
|
json j = result.value();
|
||||||
error_code ec = JsonReplace(j, path, cb);
|
error_code ec = JsonReplace(j, path, cb);
|
||||||
if (ec) {
|
if (ec) {
|
||||||
VLOG(1) << "Failed to evaulate expression on json with error: " << ec.message();
|
VLOG(1) << "Failed to evaluate expression on json with error: " << ec.message();
|
||||||
return OpStatus::SYNTAX_ERR;
|
return OpStatus::SYNTAX_ERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -245,7 +245,7 @@ TEST_F(ListFamilyTest, BLPopSerialize) {
|
||||||
|
|
||||||
// Either this lpush has run first or the one below.
|
// Either this lpush has run first or the one below.
|
||||||
// In any case it must be that between 2 invocations of lpush (wrapped in multi)
|
// In any case it must be that between 2 invocations of lpush (wrapped in multi)
|
||||||
// blpop will be triggerred and it will empty the list again. Hence, in any case
|
// blpop will be triggered and it will empty the list again. Hence, in any case
|
||||||
// lpush kKey1 here and below should return 1.
|
// lpush kKey1 here and below should return 1.
|
||||||
ASSERT_THAT(resp, ArrLen(11));*/
|
ASSERT_THAT(resp, ArrLen(11));*/
|
||||||
cl1 = GetDebugInfo("IO1").clock;
|
cl1 = GetDebugInfo("IO1").clock;
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// This is an internal struct in mimalloc.
|
// This is an internal struct in mimalloc.
|
||||||
// To declare it, we must include mimalloc-types.h which is an internal header in the lib.
|
// To declare it, we must include mimalloc-types.h which is an internal header in the lib.
|
||||||
// Being such it does not interract well with some other c++ headers, therefore we
|
// Being such it does not interact well with some other c++ headers, therefore we
|
||||||
// use a clean cc file to extract data from this record.
|
// use a clean cc file to extract data from this record.
|
||||||
extern "C" mi_stats_t _mi_stats_main;
|
extern "C" mi_stats_t _mi_stats_main;
|
||||||
|
|
||||||
|
|
|
@ -648,7 +648,7 @@ error_code RdbSerializer::SaveString(string_view val) {
|
||||||
size_t comprlen, outlen = len;
|
size_t comprlen, outlen = len;
|
||||||
tmp_buf_.resize(outlen + 1);
|
tmp_buf_.resize(outlen + 1);
|
||||||
|
|
||||||
// Due to stack constrainsts im fibers we can not allow large arrays on stack.
|
// Due to stack constraints im fibers we can not allow large arrays on stack.
|
||||||
// Therefore I am lazily allocating it on heap. It's not fixed in quicklist.
|
// Therefore I am lazily allocating it on heap. It's not fixed in quicklist.
|
||||||
if (!lzf_) {
|
if (!lzf_) {
|
||||||
lzf_.reset(new LZF_HSLOT[1 << HLOG]);
|
lzf_.reset(new LZF_HSLOT[1 << HLOG]);
|
||||||
|
|
|
@ -241,7 +241,7 @@ void Replica::ReplicateFb() {
|
||||||
ec = InitiatePSync(); // redis -> df
|
ec = InitiatePSync(); // redis -> df
|
||||||
|
|
||||||
// There is a data race condition in Redis-master code, where "ACK 0" handler may be
|
// There is a data race condition in Redis-master code, where "ACK 0" handler may be
|
||||||
// triggerred
|
// triggered
|
||||||
// before Redis is ready to transition to the streaming state and it silenty ignores "ACK
|
// before Redis is ready to transition to the streaming state and it silenty ignores "ACK
|
||||||
// 0". We reduce the chance it happens with this delay.
|
// 0". We reduce the chance it happens with this delay.
|
||||||
this_fiber::sleep_for(50ms);
|
this_fiber::sleep_for(50ms);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue