Commit 2ae7f491 authored by Oran Agra's avatar Oran Agra
Browse files

Squash merging 125 typo/grammar/comment/doc PRs (#7773)



List of squashed commits or PRs
===============================

commit 66801ea
Author: hwware <wen.hui.ware@gmail.com>
Date:   Mon Jan 13 00:54:31 2020 -0500

    typo fix in acl.c

commit 46f55db
Author: Itamar Haber <itamar@redislabs.com>
Date:   Sun Sep 6 18:24:11 2020 +0300

    Updates a couple of comments

    Specifically:

    * RM_AutoMemory completed instead of pointing to docs
    * Updated link to custom type doc

commit 61a2aa0
Author: xindoo <xindoo@qq.com>
Date:   Tue Sep 1 19:24:59 2020 +0800

    Correct errors in code comments

commit a5871d1
Author: yz1509 <pro-756@qq.com>
Date:   Tue Sep 1 18:36:06 2020 +0800

    fix typos in module.c

commit 41eede7
Author: bookug <bookug@qq.com>
Date:   Sat Aug 15 01:11:33 2020 +0800

    docs: fix typos in comments

commit c303c84
Author: lazy-snail <ws.niu@outlook.com>
Date:   Fri Aug 7 11:15:44 2020 +0800

    fix spelling in redis.conf

commit 1eb76bf
Author: zhujian <zhujianxyz@gmail.com>
Date:   Thu Aug 6 15:22:10 2020 +0800

    add a missing 'n' in comment

commit 1530ec2
Author: Daniel Dai <764122422@qq.com>
Date:   Mon Jul 27 00:46:35 2020 -0400

    fix spelling in tracking.c

commit e517b31
Author: Hunter-Chen <huntcool001@gmail.com>
Date:   Fri Jul 17 22:33:32 2020 +0800

    Update redis.conf
Co-authored-by: default avatarItamar Haber <itamar@redislabs.com>

commit c300eff
Author: Hunter-Chen <huntcool001@gmail.com>
Date:   Fri Jul 17 22:33:23 2020 +0800

    Update redis.conf
Co-authored-by: default avatarItamar Haber <itamar@redislabs.com>

commit 4c058a8
Author: 陈浩鹏 <chenhaopeng@heytea.com>
Date:   Thu Jun 25 19:00:56 2020 +0800

    Grammar fix and clarification

commit 5fcaa81
Author: bodong.ybd <bodong.ybd@alibaba-inc.com>
Date:   Fri Jun 19 10:09:00 2020 +0800

    Fix typos

commit 4caca9a
Author: Pruthvi P <pruthvi@ixigo.com>
Date:   Fri May 22 00:33:22 2020 +0530

    Fix typo eviciton => eviction

commit b2a25f6
Author: Brad Dunbar <dunbarb2@gmail.com>
Date:   Sun May 17 12:39:59 2020 -0400

    Fix a typo.

commit 12842ae
Author: hwware <wen.hui.ware@gmail.com>
Date:   Sun May 3 17:16:59 2020 -0400

    fix spelling in redis conf

commit ddba07c
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date:   Sat May 2 23:25:34 2020 +0100

    Correct a "conflicts" spelling error.

commit 8fc7bf2
Author: Nao YONASHIRO <yonashiro@r.recruit.co.jp>
Date:   Thu Apr 30 10:25:27 2020 +0900

    docs: fix EXPIRE_FAST_CYCLE_DURATION to ACTIVE_EXPIRE_CYCLE_FAST_DURATION

commit 9b2b67a
Author: Brad Dunbar <dunbarb2@gmail.com>
Date:   Fri Apr 24 11:46:22 2020 -0400

    Fix a typo.

commit 0746f10
Author: devilinrust <63737265+devilinrust@users.noreply.github.com>
Date:   Thu Apr 16 00:17:53 2020 +0200

    Fix typos in server.c

commit 92b588d
Author: benjessop12 <56115861+benjessop12@users.noreply.github.com>
Date:   Mon Apr 13 13:43:55 2020 +0100

    Fix spelling mistake in lazyfree.c

commit 1da37aa
Merge: 2d4ba28 af347a8c
Author: hwware <wen.hui.ware@gmail.com>
Date:   Thu Mar 5 22:41:31 2020 -0500

    Merge remote-tracking branch 'upstream/unstable' into expiretypofix

commit 2d4ba28
Author: hwware <wen.hui.ware@gmail.com>
Date:   Mon Mar 2 00:09:40 2020 -0500

    fix typo in expire.c

commit 1a746f7
Author: SennoYuki <minakami1yuki@gmail.com>
Date:   Thu Feb 27 16:54:32 2020 +0800

    fix typo

commit 8599b1a
Author: dongheejeong <donghee950403@gmail.com>
Date:   Sun Feb 16 20:31:43 2020 +0000

    Fix typo in server.c

commit f38d4e8
Author: hwware <wen.hui.ware@gmail.com>
Date:   Sun Feb 2 22:58:38 2020 -0500

    fix typo in evict.c

commit fe143fc
Author: Leo Murillo <leonardo.murillo@gmail.com>
Date:   Sun Feb 2 01:57:22 2020 -0600

    Fix a few typos in redis.conf

commit 1ab4d21
Author: viraja1 <anchan.viraj@gmail.com>
Date:   Fri Dec 27 17:15:58 2019 +0530

    Fix typo in Latency API docstring

commit ca1f70e
Author: gosth <danxuedexing@qq.com>
Date:   Wed Dec 18 15:18:02 2019 +0800

    fix typo in sort.c

commit a57c06b
Author: ZYunH <zyunhjob@163.com>
Date:   Mon Dec 16 22:28:46 2019 +0800

    fix-zset-typo

commit b8c92b5
Author: git-hulk <hulk.website@gmail.com>
Date:   Mon Dec 16 15:51:42 2019 +0800

    FIX: typo in cluster.c, onformation->information

commit 9dd981c
Author: wujm2007 <jim.wujm@gmail.com>
Date:   Mon Dec 16 09:37:52 2019 +0800

    Fix typo

commit e132d7a
Author: Sebastien Williams-Wynn <s.williamswynn.mail@gmail.com>
Date:   Fri Nov 15 00:14:07 2019 +0000

    Minor typo change

commit 47f44d5
Author: happynote3966 <01ssrmikururudevice01@gmail.com>
Date:   Mon Nov 11 22:08:48 2019 +0900

    fix comment typo in redis-cli.c

commit b8bdb0d
Author: fulei <fulei@kuaishou.com>
Date:   Wed Oct 16 18:00:17 2019 +0800

    Fix a spelling mistake of comments  in defragDictBucketCallback

commit 0def46a
Author: fulei <fulei@kuaishou.com>
Date:   Wed Oct 16 13:09:27 2019 +0800

    fix some spelling mistakes of comments in defrag.c

commit f3596fd
Author: Phil Rajchgot <tophil@outlook.com>
Date:   Sun Oct 13 02:02:32 2019 -0400

    Typo and grammar fixes

    Redis and its documentation are great -- just wanted to submit a few corrections in the spirit of Hacktoberfest. Thanks for all your work on this project. I use it all the time and it works beautifully.

commit 2b928cd
Author: KangZhiDong <worldkzd@gmail.com>
Date:   Sun Sep 1 07:03:11 2019 +0800

    fix typos

commit 33aea14
Author: Axlgrep <axlgrep@gmail.com>
Date:   Tue Aug 27 11:02:18 2019 +0800

    Fixed eviction spelling issues

commit e282a80
Author: Simen Flatby <simen@oms.no>
Date:   Tue Aug 20 15:25:51 2019 +0200

    Update comments to reflect prop name

    In the comments the prop is referenced as replica-validity-factor,
    but it is really named cluster-replica-validity-factor.

commit 74d1f9a
Author: Jim Green <jimgreen2013@qq.com>
Date:   Tue Aug 20 20:00:31 2019 +0800

    fix comment error, the code is ok

commit eea1407
Author: Liao Tonglang <liaotonglang@gmail.com>
Date:   Fri May 31 10:16:18 2019 +0800

    typo fix

    fix cna't to can't

commit 0da553c
Author: KAWACHI Takashi <tkawachi@gmail.com>
Date:   Wed Jul 17 00:38:16 2019 +0900

    Fix typo

commit 7fc8fb6
Author: Michael Prokop <mika@grml.org>
Date:   Tue May 28 17:58:42 2019 +0200

    Typo fixes

    s/familar/familiar/
    s/compatiblity/compatibility/
    s/ ot / to /
    s/itsef/itself/

commit 5f46c9d
Author: zhumoing <34539422+zhumoing@users.noreply.github.com>
Date:   Tue May 21 21:16:50 2019 +0800

    typo-fixes

    typo-fixes

commit 321dfe1
Author: wxisme <850885154@qq.com>
Date:   Sat Mar 16 15:10:55 2019 +0800

    typo fix

commit b4fb131
Merge: 267e0e6 3df1eb85
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date:   Fri Feb 8 22:55:45 2019 +0200

    Merge branch 'unstable' of antirez/redis into unstable

commit 267e0e6
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date:   Wed Jan 30 21:26:04 2019 +0200

    Minor typo fix

commit 30544e7
Author: inshal96 <39904558+inshal96@users.noreply.github.com>
Date:   Fri Jan 4 16:54:50 2019 +0500

    remove an extra 'a' in the comments

commit 337969d
Author: BrotherGao <yangdongheng11@gmail.com>
Date:   Sat Dec 29 12:37:29 2018 +0800

    fix typo in redis.conf

commit 9f4b121
Merge: 423a030 e504583b
Author: BrotherGao <yangdongheng@xiaomi.com>
Date:   Sat Dec 29 11:41:12 2018 +0800

    Merge branch 'unstable' of antirez/redis into unstable

commit 423a030
Merge: 42b02b7 46a51cdc
Author: 杨东衡 <yangdongheng@xiaomi.com>
Date:   Tue Dec 4 23:56:11 2018 +0800

    Merge branch 'unstable' of antirez/redis into unstable

commit 42b02b7
Merge: 68c0e6e3 b8febe60


Author: Dongheng Yang <yangdongheng11@gmail.com>
Date:   Sun Oct 28 15:54:23 2018 +0800

    Merge pull request #1 from antirez/unstable

    update local data

commit 714b589
Author: Christian <crifei93@gmail.com>
Date:   Fri Dec 28 01:17:26 2018 +0100

    fix typo "resulution"

commit e23259d
Author: garenchan <1412950785@qq.com>
Date:   Wed Dec 26 09:58:35 2018 +0800

    fix typo: segfauls -> segfault

commit a9359f8
Author: xjp <jianping_xie@aliyun.com>
Date:   Tue Dec 18 17:31:44 2018 +0800

    Fixed REDISMODULE_H spell bug

commit a12c3e4
Author: jdiaz <jrd.palacios@gmail.com>
Date:   Sat Dec 15 23:39:52 2018 -0600

    Fixes hyperloglog hash function comment block description

commit 770eb11
Author: 林上耀 <1210tom@163.com>
Date:   Sun Nov 25 17:16:10 2018 +0800

    fix typo

commit fd97fbb
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date:   Fri Nov 23 17:14:01 2018 +0100

    Correct "unsupported" typo.

commit a85522d
Author: Jungnam Lee <jungnam.lee@oracle.com>
Date:   Thu Nov 8 23:01:29 2018 +0900

    fix typo in test comments

commit ade8007
Author: Arun Kumar <palerdot@users.noreply.github.com>
Date:   Tue Oct 23 16:56:35 2018 +0530

    Fixed grammatical typo

    Fixed typo for word 'dictionary'

commit 869ee39
Author: Hamid Alaei <hamid.a85@gmail.com>
Date:   Sun Aug 12 16:40:02 2018 +0430

    fix documentations: (ThreadSafeContextStart/Stop -> ThreadSafeContextLock/Unlock), minor typo

commit f89d158
Author: Mayank Jain <mayankjain255@gmail.com>
Date:   Tue Jul 31 23:01:21 2018 +0530

    Updated README.md with some spelling corrections.

    Made correction in spelling of some misspelled words.

commit 892198e
Author: dsomeshwar <someshwar.dhayalan@gmail.com>
Date:   Sat Jul 21 23:23:04 2018 +0530

    typo fix

commit 8a4d780
Author: Itamar Haber <itamar@redislabs.com>
Date:   Mon Apr 30 02:06:52 2018 +0300

    Fixes some typos

commit e3acef6
Author: Noah Rosamilia <ivoahivoah@gmail.com>
Date:   Sat Mar 3 23:41:21 2018 -0500

    Fix typo in /deps/README.md

commit 04442fb
Author: WuYunlong <xzsyeb@126.com>
Date:   Sat Mar 3 10:32:42 2018 +0800

    Fix typo in readSyncBulkPayload() comment.

commit 9f36880
Author: WuYunlong <xzsyeb@126.com>
Date:   Sat Mar 3 10:20:37 2018 +0800

    replication.c comment: run_id -> replid.

commit f866b4a
Author: Francesco 'makevoid' Canessa <makevoid@gmail.com>
Date:   Thu Feb 22 22:01:56 2018 +0000

    fix comment typo in server.c

commit 0ebc69b
Author: 줍 <jubee0124@gmail.com>
Date:   Mon Feb 12 16:38:48 2018 +0900

    Fix typo in redis.conf

    Fix `five behaviors` to `eight behaviors` in [this sentence ](antirez/redis@unstable/redis.conf#L564)

commit b50a620
Author: martinbroadhurst <martinbroadhurst@users.noreply.github.com>
Date:   Thu Dec 28 12:07:30 2017 +0000

    Fix typo in valgrind.sup

commit 7d8f349
Author: Peter Boughton <peter@sorcerersisle.com>
Date:   Mon Nov 27 19:52:19 2017 +0000

    Update CONTRIBUTING; refer doc updates to redis-doc repo.

commit 02dec7e
Author: Klauswk <klauswk1@hotmail.com>
Date:   Tue Oct 24 16:18:38 2017 -0200

    Fix typo in comment

commit e1efbc8
Author: chenshi <baiwfg2@gmail.com>
Date:   Tue Oct 3 18:26:30 2017 +0800

    Correct two spelling errors of comments

commit 93327d8
Author: spacewander <spacewanderlzx@gmail.com>
Date:   Wed Sep 13 16:47:24 2017 +0800

    Update the comment for OBJ_ENCODING_EMBSTR_SIZE_LIMIT's value

    The value of OBJ_ENCODING_EMBSTR_SIZE_LIMIT is 44 now instead of 39.

commit 63d361f
Author: spacewander <spacewanderlzx@gmail.com>
Date:   Tue Sep 12 15:06:42 2017 +0800

    Fix <prevlen> related doc in ziplist.c

    According to the definition of ZIP_BIG_PREVLEN and other related code,
    the guard of single byte <prevlen> should be 254 instead of 255.

commit ebe228d
Author: hanael80 <hanael80@gmail.com>
Date:   Tue Aug 15 09:09:40 2017 +0900

    Fix typo

commit 6b696e6
Author: Matt Robenolt <matt@ydekproductions.com>
Date:   Mon Aug 14 14:50:47 2017 -0700

    Fix typo in LATENCY DOCTOR output

commit a2ec6ae
Author: caosiyang <caosiyang@qiyi.com>
Date:   Tue Aug 15 14:15:16 2017 +0800

    Fix a typo: form => from

commit 3ab7699
Author: caosiyang <caosiyang@qiyi.com>
Date:   Thu Aug 10 18:40:33 2017 +0800

    Fix a typo: replicationFeedSlavesFromMaster() => replicationFeedSlavesFromMasterStream()

commit 72d43ef
Author: caosiyang <caosiyang@qiyi.com>
Date:   Tue Aug 8 15:57:25 2017 +0800

    fix a typo: servewr => server

commit 707c958
Author: Bo Cai <charpty@gmail.com>
Date:   Wed Jul 26 21:49:42 2017 +0800

    redis-cli.c typo: conut -> count.
Signed-off-by: default avatarBo Cai <charpty@gmail.com>

commit b9385b2
Author: JackDrogon <jack.xsuperman@gmail.com>
Date:   Fri Jun 30 14:22:31 2017 +0800

    Fix some spell problems

commit 20d9230
Author: akosel <aaronjkosel@gmail.com>
Date:   Sun Jun 4 19:35:13 2017 -0500

    Fix typo

commit b167bfc
Author: Krzysiek Witkowicz <krzysiekwitkowicz@gmail.com>
Date:   Mon May 22 21:32:27 2017 +0100

    Fix #4008 small typo in comment

commit 2b78ac8
Author: Jake Clarkson <jacobwclarkson@gmail.com>
Date:   Wed Apr 26 15:49:50 2017 +0100

    Correct typo in tests/unit/hyperloglog.tcl

commit b0f1cdb
Author: Qi Luo <qiluo-msft@users.noreply.github.com>
Date:   Wed Apr 19 14:25:18 2017 -0700

    Fix typo

commit a90b0f9
Author: charsyam <charsyam@naver.com>
Date:   Thu Mar 16 18:19:53 2017 +0900

    fix typos

    fix typos

    fix typos

commit 8430a79
Author: Richard Hart <richardhart92@gmail.com>
Date:   Mon Mar 13 22:17:41 2017 -0400

    Fixed log message typo in listenToPort.

commit 481a1c2
Author: Vinod Kumar <kumar003vinod@gmail.com>
Date:   Sun Jan 15 23:04:51 2017 +0530

    src/db.c: Correct "save" -> "safe" typo

commit 586b4d3
Author: wangshaonan <wshn13@gmail.com>
Date:   Wed Dec 21 20:28:27 2016 +0800

    Fix typo they->the in helloworld.c

commit c1c4b5e
Author: Jenner <hypxm@qq.com>
Date:   Mon Dec 19 16:39:46 2016 +0800

    typo error

commit 1ee1a3f
Author: tielei <43289893@qq.com>
Date:   Mon Jul 18 13:52:25 2016 +0800

    fix some comments

commit 11a41fb
Author: Otto Kekäläinen <otto@seravo.fi>
Date:   Sun Jul 3 10:23:55 2016 +0100

    Fix spelling in documentation and comments

commit 5fb5d82
Author: francischan <f1ancis621@gmail.com>
Date:   Tue Jun 28 00:19:33 2016 +0800

    Fix outdated comments about redis.c file.
    It should now refer to server.c file.

commit 6b254bc
Author: lmatt-bit <lmatt123n@gmail.com>
Date:   Thu Apr 21 21:45:58 2016 +0800

    Refine the comment of dictRehashMilliseconds func

SLAVECONF->REPLCONF in comment - by andyli029

commit ee9869f
Author: clark.kang <charsyam@naver.com>
Date:   Tue Mar 22 11:09:51 2016 +0900

    fix typos

commit f7b3b11
Author: Harisankar H <harisankarh@gmail.com>
Date:   Wed Mar 9 11:49:42 2016 +0530

    Typo correction: "faield" --> "failed"

    Typo correction: "faield" --> "failed"

commit 3fd40fc
Author: Itamar Haber <itamar@redislabs.com>
Date:   Thu Feb 25 10:31:51 2016 +0200

    Fixes a typo in comments

commit 621c160
Author: Prayag Verma <prayag.verma@gmail.com>
Date:   Mon Feb 1 12:36:20 2016 +0530

    Fix typo in Readme.md

    Spelling mistakes -
    `eviciton` > `eviction`
    `familar` > `familiar`

commit d7d07d6
Author: WonCheol Lee <toctoc21c@gmail.com>
Date:   Wed Dec 30 15:11:34 2015 +0900

    Typo fixed

commit a4dade7
Author: Felix Bünemann <buenemann@louis.info>
Date:   Mon Dec 28 11:02:55 2015 +0100

    [ci skip] Improve supervised upstart config docs

    This mentions that "expect stop" is required for supervised upstart
    to work correctly. See http://upstart.ubuntu.com/cookbook/#expect-stop


    for an explanation.

commit d9caba9
Author: daurnimator <quae@daurnimator.com>
Date:   Mon Dec 21 18:30:03 2015 +1100

    README: Remove trailing whitespace

commit 72d42e5
Author: daurnimator <quae@daurnimator.com>
Date:   Mon Dec 21 18:29:32 2015 +1100

    README: Fix typo. th => the

commit dd6e957
Author: daurnimator <quae@daurnimator.com>
Date:   Mon Dec 21 18:29:20 2015 +1100

    README: Fix typo. familar => familiar

commit 3a12b23
Author: daurnimator <quae@daurnimator.com>
Date:   Mon Dec 21 18:28:54 2015 +1100

    README: Fix typo. eviciton => eviction

commit 2d1d03b
Author: daurnimator <quae@daurnimator.com>
Date:   Mon Dec 21 18:21:45 2015 +1100

    README: Fix typo. sever => server

commit 3973b06
Author: Itamar Haber <itamar@garantiadata.com>
Date:   Sat Dec 19 17:01:20 2015 +0200

    Typo fix

commit 4f2e460
Author: Steve Gao <fu@2token.com>
Date:   Fri Dec 4 10:22:05 2015 +0800

    Update README - fix typos

commit b21667c
Author: binyan <binbin.yan@nokia.com>
Date:   Wed Dec 2 22:48:37 2015 +0800

    delete redundancy color judge in sdscatcolor

commit 88894c7
Author: binyan <binbin.yan@nokia.com>
Date:   Wed Dec 2 22:14:42 2015 +0800

    the example output shoule be HelloWorld

commit 2763470
Author: binyan <binbin.yan@nokia.com>
Date:   Wed Dec 2 17:41:39 2015 +0800

    modify error word keyevente
Signed-off-by: default avatarbinyan <binbin.yan@nokia.com>

commit 0847b3d
Author: Bruno Martins <bscmartins@gmail.com>
Date:   Wed Nov 4 11:37:01 2015 +0000

    typo

commit bbb9e9e
Author: dawedawe <dawedawe@gmx.de>
Date:   Fri Mar 27 00:46:41 2015 +0100

    typo: zimap -> zipmap

commit 5ed297e
Author: Axel Advento <badwolf.bloodseeker.rev@gmail.com>
Date:   Tue Mar 3 15:58:29 2015 +0800

    Fix 'salve' typos to 'slave'

commit edec9d6
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date:   Wed Jun 12 14:12:47 2019 +0200

    Update README.md
Co-Authored-By: default avatarQix <Qix-@users.noreply.github.com>

commit 692a7af
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date:   Tue May 28 14:32:04 2019 +0200

    grammar

commit d962b0a
Author: Nick Frost <nickfrostatx@gmail.com>
Date:   Wed Jul 20 15:17:12 2016 -0700

    Minor grammar fix

commit 24fff01aaccaf5956973ada8c50ceb1462e211c6 (typos)
Author: Chad Miller <chadm@squareup.com>
Date:   Tue Sep 8 13:46:11 2020 -0400

    Fix faulty comment about operation of unlink()

commit 3cd5c1f3326c52aa552ada7ec797c6bb16452355
Author: Kevin <kevin.xgr@gmail.com>
Date:   Wed Nov 20 00:13:50 2019 +0800

    Fix typo in server.c.

From a83af59 Mon Sep 17 00:00:00 2001
From: wuwo <wuwo@wacai.com>
Date: Fri, 17 Mar 2017 20:37:45 +0800
Subject: [PATCH] falure to failure

From c961896 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B7=A6=E6=87=B6?= <veficos@gmail.com>
Date: Sat, 27 May 2017 15:33:04 +0800
Subject: [PATCH] fix typo

From e600ef2 Mon Sep 17 00:00:00 2001
From: "rui.zou" <rui.zou@yunify.com>
Date: Sat, 30 Sep 2017 12:38:15 +0800
Subject: [PATCH] fix a typo

From c7d07fa Mon Sep 17 00:00:00 2001
From: Alexandre Perrin <alex@kaworu.ch>
Date: Thu, 16 Aug 2018 10:35:31 +0200
Subject: [PATCH] deps README.md typo

From b25cb67 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 10:55:37 +0300
Subject: [PATCH 1/2] fix typos in header

From ad28ca6 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 11:02:36 +0300
Subject: [PATCH 2/2] fix typos

commit 34924cdedd8552466fc22c1168d49236cb7ee915
Author: Adrian Lynch <adi_ady_ade@hotmail.com>
Date:   Sat Apr 4 21:59:15 2015 +0100

    Typos fixed

commit fd2a1e7
Author: Jan <jsteemann@users.noreply.github.com>
Date:   Sat Oct 27 19:13:01 2018 +0200

    Fix typos

    Fix typos

commit e14e47c1a234b53b0e103c5f6a1c61481cbcbb02
Author: Andy Lester <andy@petdance.com>
Date:   Fri Aug 2 22:30:07 2019 -0500

    Fix multiple misspellings of "following"

commit 79b948ce2dac6b453fe80995abbcaac04c213d5a
Author: Andy Lester <andy@petdance.com>
Date:   Fri Aug 2 22:24:28 2019 -0500

    Fix misspelling of create-cluster

commit 1fffde52666dc99ab35efbd31071a4c008cb5a71
Author: Andy Lester <andy@petdance.com>
Date:   Wed Jul 31 17:57:56 2019 -0500

    Fix typos

commit 204c9ba9651e9e05fd73936b452b9a30be456cfe
Author: Xiaobo Zhu <xiaobo.zhu@shopee.com>
Date:   Tue Aug 13 22:19:25 2019 +0800

    fix typos

Squashed commit of the following:

commit 1d9aaf8
Author: danmedani <danmedani@gmail.com>
Date:   Sun Aug 2 11:40:26 2015 -0700

README typo fix.

Squashed commit of the following:

commit 32bfa7c
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date:   Mon Jul 6 21:15:08 2015 +0200

Fixed grammer

Squashed commit of the following:

commit b24f69c
Author: Sisir Koppaka <sisir.koppaka@gmail.com>
Date:   Mon Mar 2 22:38:45 2015 -0500

utils/hashtable/rehashing.c: Fix typos

Squashed commit of the following:

commit 4e04082
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date:   Mon Mar 23 08:22:21 2015 +0000

Small config file documentation improvements

Squashed commit of the following:

commit acb8773
Author: ctd1500 <ctd1500@gmail.com>
Date:   Fri May 8 01:52:48 2015 -0700

Typo and grammar fixes in readme

commit 2eb75b6
Author: ctd1500 <ctd1500@gmail.com>
Date:   Fri May 8 01:36:18 2015 -0700

fixed redis.conf comment

Squashed commit of the following:

commit a8249a2
Author: Masahiko Sawada <sawada.mshk@gmail.com>
Date:   Fri Dec 11 11:39:52 2015 +0530

Revise correction of typos.

Squashed commit of the following:

commit 3c02028
Author: zhaojun11 <zhaojun11@jd.com>
Date:   Wed Jan 17 19:05:28 2018 +0800

Fix typos include two code typos in cluster.c and latency.c

Squashed commit of the following:

commit 9dba47c
Author: q191201771 <191201771@qq.com>
Date:   Sat Jan 4 11:31:04 2020 +0800

fix function listCreate comment in adlist.c

Update src/server.c

commit 2c7c2cb536e78dd211b1ac6f7bda00f0f54faaeb
Author: charpty <charpty@gmail.com>
Date:   Tue May 1 23:16:59 2018 +0800

    server.c typo: modules system dictionary type comment
Signed-off-by: default avatarcharpty <charpty@gmail.com>

commit a8395323fb63cb59cb3591cb0f0c8edb7c29a680
Author: Itamar Haber <itamar@redislabs.com>
Date:   Sun May 6 00:25:18 2018 +0300

    Updates test_helper.tcl's help with undocumented options

    Specifically:

    * Host
    * Port
    * Client

commit bde6f9ced15755cd6407b4af7d601b030f36d60b
Author: wxisme <850885154@qq.com>
Date:   Wed Aug 8 15:19:19 2018 +0800

    fix comments in deps files

commit 3172474ba991532ab799ee1873439f3402412331
Author: wxisme <850885154@qq.com>
Date:   Wed Aug 8 14:33:49 2018 +0800

    fix some comments

commit 01b6f2b6858b5cf2ce4ad5092d2c746e755f53f0
Author: Thor Juhasz <thor@juhasz.pro>
Date:   Sun Nov 18 14:37:41 2018 +0100

    Minor fixes to comments

    Found some parts a little unclear on a first read, which prompted me to have a better look at the file and fix some minor things I noticed.
    Fixing minor typos and grammar. There are no changes to configuration options.
    These changes are only meant to help the user better understand the explanations to the various configuration options

(cherry picked from commit 1c710385)
parent 03b59cd5
...@@ -387,7 +387,7 @@ void debugCommand(client *c) { ...@@ -387,7 +387,7 @@ void debugCommand(client *c) {
"OOM -- Crash the server simulating an out-of-memory error.", "OOM -- Crash the server simulating an out-of-memory error.",
"PANIC -- Crash the server simulating a panic.", "PANIC -- Crash the server simulating a panic.",
"POPULATE <count> [prefix] [size] -- Create <count> string keys named key:<num>. If a prefix is specified is used instead of the 'key' prefix.", "POPULATE <count> [prefix] [size] -- Create <count> string keys named key:<num>. If a prefix is specified is used instead of the 'key' prefix.",
"RELOAD [MERGE] [NOFLUSH] [NOSAVE] -- Save the RDB on disk and reload it back in memory. By default it will save the RDB file and load it back. With the NOFLUSH option the current database is not removed before loading the new one, but conficts in keys will kill the server with an exception. When MERGE is used, conflicting keys will be loaded (the key in the loaded RDB file will win). When NOSAVE is used, the server will not save the current dataset in the RDB file before loading. Use DEBUG RELOAD NOSAVE when you want just to load the RDB file you placed in the Redis working directory in order to replace the current dataset in memory. Use DEBUG RELOAD NOSAVE NOFLUSH MERGE when you want to add what is in the current RDB file placed in the Redis current directory, with the current memory content. Use DEBUG RELOAD when you want to verify Redis is able to persist the current dataset in the RDB file, flush the memory content, and load it back.", "RELOAD [MERGE] [NOFLUSH] [NOSAVE] -- Save the RDB on disk and reload it back in memory. By default it will save the RDB file and load it back. With the NOFLUSH option the current database is not removed before loading the new one, but conflicts in keys will kill the server with an exception. When MERGE is used, conflicting keys will be loaded (the key in the loaded RDB file will win). When NOSAVE is used, the server will not save the current dataset in the RDB file before loading. Use DEBUG RELOAD NOSAVE when you want just to load the RDB file you placed in the Redis working directory in order to replace the current dataset in memory. Use DEBUG RELOAD NOSAVE NOFLUSH MERGE when you want to add what is in the current RDB file placed in the Redis current directory, with the current memory content. Use DEBUG RELOAD when you want to verify Redis is able to persist the current dataset in the RDB file, flush the memory content, and load it back.",
"RESTART -- Graceful restart: save config, db, restart.", "RESTART -- Graceful restart: save config, db, restart.",
"SDSLEN <key> -- Show low level SDS string info representing key and value.", "SDSLEN <key> -- Show low level SDS string info representing key and value.",
"SEGFAULT -- Crash the server with sigsegv.", "SEGFAULT -- Crash the server with sigsegv.",
...@@ -456,7 +456,7 @@ NULL ...@@ -456,7 +456,7 @@ NULL
} }
} }
/* The default beahvior is to save the RDB file before loading /* The default behavior is to save the RDB file before loading
* it back. */ * it back. */
if (save) { if (save) {
rdbSaveInfo rsi, *rsiptr; rdbSaveInfo rsi, *rsiptr;
...@@ -1449,7 +1449,7 @@ void logCurrentClient(void) { ...@@ -1449,7 +1449,7 @@ void logCurrentClient(void) {
#define MEMTEST_MAX_REGIONS 128 #define MEMTEST_MAX_REGIONS 128
/* A non destructive memory test executed during segfauls. */ /* A non destructive memory test executed during segfault. */
int memtest_test_linux_anonymous_maps(void) { int memtest_test_linux_anonymous_maps(void) {
FILE *fp; FILE *fp;
char line[1024]; char line[1024];
......
...@@ -47,11 +47,11 @@ int je_get_defrag_hint(void* ptr); ...@@ -47,11 +47,11 @@ int je_get_defrag_hint(void* ptr);
/* forward declarations*/ /* forward declarations*/
void defragDictBucketCallback(void *privdata, dictEntry **bucketref); void defragDictBucketCallback(void *privdata, dictEntry **bucketref);
dictEntry* replaceSateliteDictKeyPtrAndOrDefragDictEntry(dict *d, sds oldkey, sds newkey, uint64_t hash, long *defragged); dictEntry* replaceSatelliteDictKeyPtrAndOrDefragDictEntry(dict *d, sds oldkey, sds newkey, uint64_t hash, long *defragged);
/* Defrag helper for generic allocations. /* Defrag helper for generic allocations.
* *
* returns NULL in case the allocatoin wasn't moved. * returns NULL in case the allocation wasn't moved.
* when it returns a non-null value, the old pointer was already released * when it returns a non-null value, the old pointer was already released
* and should NOT be accessed. */ * and should NOT be accessed. */
void* activeDefragAlloc(void *ptr) { void* activeDefragAlloc(void *ptr) {
...@@ -74,7 +74,7 @@ void* activeDefragAlloc(void *ptr) { ...@@ -74,7 +74,7 @@ void* activeDefragAlloc(void *ptr) {
/*Defrag helper for sds strings /*Defrag helper for sds strings
* *
* returns NULL in case the allocatoin wasn't moved. * returns NULL in case the allocation wasn't moved.
* when it returns a non-null value, the old pointer was already released * when it returns a non-null value, the old pointer was already released
* and should NOT be accessed. */ * and should NOT be accessed. */
sds activeDefragSds(sds sdsptr) { sds activeDefragSds(sds sdsptr) {
...@@ -90,7 +90,7 @@ sds activeDefragSds(sds sdsptr) { ...@@ -90,7 +90,7 @@ sds activeDefragSds(sds sdsptr) {
/* Defrag helper for robj and/or string objects /* Defrag helper for robj and/or string objects
* *
* returns NULL in case the allocatoin wasn't moved. * returns NULL in case the allocation wasn't moved.
* when it returns a non-null value, the old pointer was already released * when it returns a non-null value, the old pointer was already released
* and should NOT be accessed. */ * and should NOT be accessed. */
robj *activeDefragStringOb(robj* ob, long *defragged) { robj *activeDefragStringOb(robj* ob, long *defragged) {
...@@ -130,11 +130,11 @@ robj *activeDefragStringOb(robj* ob, long *defragged) { ...@@ -130,11 +130,11 @@ robj *activeDefragStringOb(robj* ob, long *defragged) {
} }
/* Defrag helper for dictEntries to be used during dict iteration (called on /* Defrag helper for dictEntries to be used during dict iteration (called on
* each step). Teturns a stat of how many pointers were moved. */ * each step). Returns a stat of how many pointers were moved. */
long dictIterDefragEntry(dictIterator *iter) { long dictIterDefragEntry(dictIterator *iter) {
/* This function is a little bit dirty since it messes with the internals /* This function is a little bit dirty since it messes with the internals
* of the dict and it's iterator, but the benefit is that it is very easy * of the dict and it's iterator, but the benefit is that it is very easy
* to use, and require no other chagnes in the dict. */ * to use, and require no other changes in the dict. */
long defragged = 0; long defragged = 0;
dictht *ht; dictht *ht;
/* Handle the next entry (if there is one), and update the pointer in the /* Handle the next entry (if there is one), and update the pointer in the
...@@ -238,7 +238,7 @@ double *zslDefrag(zskiplist *zsl, double score, sds oldele, sds newele) { ...@@ -238,7 +238,7 @@ double *zslDefrag(zskiplist *zsl, double score, sds oldele, sds newele) {
return NULL; return NULL;
} }
/* Defrag helpler for sorted set. /* Defrag helper for sorted set.
* Defrag a single dict entry key name, and corresponding skiplist struct */ * Defrag a single dict entry key name, and corresponding skiplist struct */
long activeDefragZsetEntry(zset *zs, dictEntry *de) { long activeDefragZsetEntry(zset *zs, dictEntry *de) {
sds newsds; sds newsds;
...@@ -349,7 +349,7 @@ long activeDefragSdsListAndDict(list *l, dict *d, int dict_val_type) { ...@@ -349,7 +349,7 @@ long activeDefragSdsListAndDict(list *l, dict *d, int dict_val_type) {
if ((newsds = activeDefragSds(sdsele))) { if ((newsds = activeDefragSds(sdsele))) {
/* When defragging an sds value, we need to update the dict key */ /* When defragging an sds value, we need to update the dict key */
uint64_t hash = dictGetHash(d, newsds); uint64_t hash = dictGetHash(d, newsds);
replaceSateliteDictKeyPtrAndOrDefragDictEntry(d, sdsele, newsds, hash, &defragged); replaceSatelliteDictKeyPtrAndOrDefragDictEntry(d, sdsele, newsds, hash, &defragged);
ln->value = newsds; ln->value = newsds;
defragged++; defragged++;
} }
...@@ -385,7 +385,7 @@ long activeDefragSdsListAndDict(list *l, dict *d, int dict_val_type) { ...@@ -385,7 +385,7 @@ long activeDefragSdsListAndDict(list *l, dict *d, int dict_val_type) {
* moved. Return value is the the dictEntry if found, or NULL if not found. * moved. Return value is the the dictEntry if found, or NULL if not found.
* NOTE: this is very ugly code, but it let's us avoid the complication of * NOTE: this is very ugly code, but it let's us avoid the complication of
* doing a scan on another dict. */ * doing a scan on another dict. */
dictEntry* replaceSateliteDictKeyPtrAndOrDefragDictEntry(dict *d, sds oldkey, sds newkey, uint64_t hash, long *defragged) { dictEntry* replaceSatelliteDictKeyPtrAndOrDefragDictEntry(dict *d, sds oldkey, sds newkey, uint64_t hash, long *defragged) {
dictEntry **deref = dictFindEntryRefByPtrAndHash(d, oldkey, hash); dictEntry **deref = dictFindEntryRefByPtrAndHash(d, oldkey, hash);
if (deref) { if (deref) {
dictEntry *de = *deref; dictEntry *de = *deref;
...@@ -433,7 +433,7 @@ long activeDefragQuickListNodes(quicklist *ql) { ...@@ -433,7 +433,7 @@ long activeDefragQuickListNodes(quicklist *ql) {
} }
/* when the value has lots of elements, we want to handle it later and not as /* when the value has lots of elements, we want to handle it later and not as
* oart of the main dictionary scan. this is needed in order to prevent latency * part of the main dictionary scan. this is needed in order to prevent latency
* spikes when handling large items */ * spikes when handling large items */
void defragLater(redisDb *db, dictEntry *kde) { void defragLater(redisDb *db, dictEntry *kde) {
sds key = sdsdup(dictGetKey(kde)); sds key = sdsdup(dictGetKey(kde));
...@@ -814,7 +814,7 @@ long defragKey(redisDb *db, dictEntry *de) { ...@@ -814,7 +814,7 @@ long defragKey(redisDb *db, dictEntry *de) {
* I can't search in db->expires for that key after i already released * I can't search in db->expires for that key after i already released
* the pointer it holds it won't be able to do the string compare */ * the pointer it holds it won't be able to do the string compare */
uint64_t hash = dictGetHash(db->dict, de->key); uint64_t hash = dictGetHash(db->dict, de->key);
replaceSateliteDictKeyPtrAndOrDefragDictEntry(db->expires, keysds, newsds, hash, &defragged); replaceSatelliteDictKeyPtrAndOrDefragDictEntry(db->expires, keysds, newsds, hash, &defragged);
} }
/* Try to defrag robj and / or string value. */ /* Try to defrag robj and / or string value. */
...@@ -885,7 +885,7 @@ void defragScanCallback(void *privdata, const dictEntry *de) { ...@@ -885,7 +885,7 @@ void defragScanCallback(void *privdata, const dictEntry *de) {
server.stat_active_defrag_scanned++; server.stat_active_defrag_scanned++;
} }
/* Defrag scan callback for each hash table bicket, /* Defrag scan callback for each hash table bucket,
* used in order to defrag the dictEntry allocations. */ * used in order to defrag the dictEntry allocations. */
void defragDictBucketCallback(void *privdata, dictEntry **bucketref) { void defragDictBucketCallback(void *privdata, dictEntry **bucketref) {
UNUSED(privdata); /* NOTE: this function is also used by both activeDefragCycle and scanLaterHash, etc. don't use privdata */ UNUSED(privdata); /* NOTE: this function is also used by both activeDefragCycle and scanLaterHash, etc. don't use privdata */
...@@ -919,7 +919,7 @@ float getAllocatorFragmentation(size_t *out_frag_bytes) { ...@@ -919,7 +919,7 @@ float getAllocatorFragmentation(size_t *out_frag_bytes) {
return frag_pct; return frag_pct;
} }
/* We may need to defrag other globals, one small allcation can hold a full allocator run. /* We may need to defrag other globals, one small allocation can hold a full allocator run.
* so although small, it is still important to defrag these */ * so although small, it is still important to defrag these */
long defragOtherGlobals() { long defragOtherGlobals() {
long defragged = 0; long defragged = 0;
...@@ -1090,7 +1090,7 @@ void activeDefragCycle(void) { ...@@ -1090,7 +1090,7 @@ void activeDefragCycle(void) {
if (hasActiveChildProcess()) if (hasActiveChildProcess())
return; /* Defragging memory while there's a fork will just do damage. */ return; /* Defragging memory while there's a fork will just do damage. */
/* Once a second, check if we the fragmentation justfies starting a scan /* Once a second, check if the fragmentation justfies starting a scan
* or making it more aggressive. */ * or making it more aggressive. */
run_with_period(1000) { run_with_period(1000) {
computeDefragCycles(); computeDefragCycles();
...@@ -1160,7 +1160,7 @@ void activeDefragCycle(void) { ...@@ -1160,7 +1160,7 @@ void activeDefragCycle(void) {
* (if we have a lot of pointers in one hash bucket or rehasing), * (if we have a lot of pointers in one hash bucket or rehasing),
* check if we reached the time limit. * check if we reached the time limit.
* But regardless, don't start a new db in this loop, this is because after * But regardless, don't start a new db in this loop, this is because after
* the last db we call defragOtherGlobals, which must be done in once cycle */ * the last db we call defragOtherGlobals, which must be done in one cycle */
if (!cursor || (++iterations > 16 || if (!cursor || (++iterations > 16 ||
server.stat_active_defrag_hits - prev_defragged > 512 || server.stat_active_defrag_hits - prev_defragged > 512 ||
server.stat_active_defrag_scanned - prev_scanned > 64)) { server.stat_active_defrag_scanned - prev_scanned > 64)) {
......
...@@ -237,7 +237,9 @@ long long timeInMilliseconds(void) { ...@@ -237,7 +237,9 @@ long long timeInMilliseconds(void) {
return (((long long)tv.tv_sec)*1000)+(tv.tv_usec/1000); return (((long long)tv.tv_sec)*1000)+(tv.tv_usec/1000);
} }
/* Rehash for an amount of time between ms milliseconds and ms+1 milliseconds */ /* Rehash in ms+"delta" milliseconds. The value of "delta" is larger
* than 0, and is smaller than 1 in most cases. The exact upper bound
* depends on the running time of dictRehash(d,100).*/
int dictRehashMilliseconds(dict *d, int ms) { int dictRehashMilliseconds(dict *d, int ms) {
long long start = timeInMilliseconds(); long long start = timeInMilliseconds();
int rehashes = 0; int rehashes = 0;
...@@ -749,7 +751,7 @@ unsigned int dictGetSomeKeys(dict *d, dictEntry **des, unsigned int count) { ...@@ -749,7 +751,7 @@ unsigned int dictGetSomeKeys(dict *d, dictEntry **des, unsigned int count) {
* this function instead what we do is to consider a "linear" range of the table * this function instead what we do is to consider a "linear" range of the table
* that may be constituted of N buckets with chains of different lengths * that may be constituted of N buckets with chains of different lengths
* appearing one after the other. Then we report a random element in the range. * appearing one after the other. Then we report a random element in the range.
* In this way we smooth away the problem of different chain lenghts. */ * In this way we smooth away the problem of different chain lengths. */
#define GETFAIR_NUM_ENTRIES 15 #define GETFAIR_NUM_ENTRIES 15
dictEntry *dictGetFairRandomKey(dict *d) { dictEntry *dictGetFairRandomKey(dict *d) {
dictEntry *entries[GETFAIR_NUM_ENTRIES]; dictEntry *entries[GETFAIR_NUM_ENTRIES];
...@@ -1119,7 +1121,7 @@ size_t _dictGetStatsHt(char *buf, size_t bufsize, dictht *ht, int tableid) { ...@@ -1119,7 +1121,7 @@ size_t _dictGetStatsHt(char *buf, size_t bufsize, dictht *ht, int tableid) {
i, clvector[i], ((float)clvector[i]/ht->size)*100); i, clvector[i], ((float)clvector[i]/ht->size)*100);
} }
/* Unlike snprintf(), teturn the number of characters actually written. */ /* Unlike snprintf(), return the number of characters actually written. */
if (bufsize) buf[bufsize-1] = '\0'; if (bufsize) buf[bufsize-1] = '\0';
return strlen(buf); return strlen(buf);
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* to be backward compatible are still in big endian) because most of the * to be backward compatible are still in big endian) because most of the
* production environments are little endian, and we have a lot of conversions * production environments are little endian, and we have a lot of conversions
* in a few places because ziplists, intsets, zipmaps, need to be endian-neutral * in a few places because ziplists, intsets, zipmaps, need to be endian-neutral
* even in memory, since they are serialied on RDB files directly with a single * even in memory, since they are serialized on RDB files directly with a single
* write(2) without other additional steps. * write(2) without other additional steps.
* *
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
/* To improve the quality of the LRU approximation we take a set of keys /* To improve the quality of the LRU approximation we take a set of keys
* that are good candidate for eviction across freeMemoryIfNeeded() calls. * that are good candidate for eviction across freeMemoryIfNeeded() calls.
* *
* Entries inside the eviciton pool are taken ordered by idle time, putting * Entries inside the eviction pool are taken ordered by idle time, putting
* greater idle times to the right (ascending order). * greater idle times to the right (ascending order).
* *
* When an LFU policy is used instead, a reverse frequency indication is used * When an LFU policy is used instead, a reverse frequency indication is used
...@@ -242,7 +242,7 @@ void evictionPoolPopulate(int dbid, dict *sampledict, dict *keydict, struct evic ...@@ -242,7 +242,7 @@ void evictionPoolPopulate(int dbid, dict *sampledict, dict *keydict, struct evic
/* Try to reuse the cached SDS string allocated in the pool entry, /* Try to reuse the cached SDS string allocated in the pool entry,
* because allocating and deallocating this object is costly * because allocating and deallocating this object is costly
* (according to the profiler, not my fantasy. Remember: * (according to the profiler, not my fantasy. Remember:
* premature optimizbla bla bla bla. */ * premature optimization bla bla bla. */
int klen = sdslen(key); int klen = sdslen(key);
if (klen > EVPOOL_CACHED_SDS_SIZE) { if (klen > EVPOOL_CACHED_SDS_SIZE) {
pool[k].key = sdsdup(key); pool[k].key = sdsdup(key);
...@@ -342,7 +342,7 @@ unsigned long LFUDecrAndReturn(robj *o) { ...@@ -342,7 +342,7 @@ unsigned long LFUDecrAndReturn(robj *o) {
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
* The external API for eviction: freeMemroyIfNeeded() is called by the * The external API for eviction: freeMemoryIfNeeded() is called by the
* server when there is data to add in order to make space if needed. * server when there is data to add in order to make space if needed.
* --------------------------------------------------------------------------*/ * --------------------------------------------------------------------------*/
...@@ -441,7 +441,7 @@ int getMaxmemoryState(size_t *total, size_t *logical, size_t *tofree, float *lev ...@@ -441,7 +441,7 @@ int getMaxmemoryState(size_t *total, size_t *logical, size_t *tofree, float *lev
* *
* The function returns C_OK if we are under the memory limit or if we * The function returns C_OK if we are under the memory limit or if we
* were over the limit, but the attempt to free memory was successful. * were over the limit, but the attempt to free memory was successful.
* Otehrwise if we are over the memory limit, but not enough memory * Otherwise if we are over the memory limit, but not enough memory
* was freed to return back under the limit, the function returns C_ERR. */ * was freed to return back under the limit, the function returns C_ERR. */
int freeMemoryIfNeeded(void) { int freeMemoryIfNeeded(void) {
int keys_freed = 0; int keys_freed = 0;
......
...@@ -97,7 +97,7 @@ int activeExpireCycleTryExpire(redisDb *db, dictEntry *de, long long now) { ...@@ -97,7 +97,7 @@ int activeExpireCycleTryExpire(redisDb *db, dictEntry *de, long long now) {
* conditions: * conditions:
* *
* If type is ACTIVE_EXPIRE_CYCLE_FAST the function will try to run a * If type is ACTIVE_EXPIRE_CYCLE_FAST the function will try to run a
* "fast" expire cycle that takes no longer than EXPIRE_FAST_CYCLE_DURATION * "fast" expire cycle that takes no longer than ACTIVE_EXPIRE_CYCLE_FAST_DURATION
* microseconds, and is not repeated again before the same amount of time. * microseconds, and is not repeated again before the same amount of time.
* The cycle will also refuse to run at all if the latest slow cycle did not * The cycle will also refuse to run at all if the latest slow cycle did not
* terminate because of a time limit condition. * terminate because of a time limit condition.
...@@ -414,7 +414,7 @@ void expireSlaveKeys(void) { ...@@ -414,7 +414,7 @@ void expireSlaveKeys(void) {
else else
dictDelete(slaveKeysWithExpire,keyname); dictDelete(slaveKeysWithExpire,keyname);
/* Stop conditions: found 3 keys we cna't expire in a row or /* Stop conditions: found 3 keys we can't expire in a row or
* time limit was reached. */ * time limit was reached. */
cycles++; cycles++;
if (noexpire > 3) break; if (noexpire > 3) break;
...@@ -466,7 +466,7 @@ size_t getSlaveKeyWithExpireCount(void) { ...@@ -466,7 +466,7 @@ size_t getSlaveKeyWithExpireCount(void) {
* *
* Note: technically we should handle the case of a single DB being flushed * Note: technically we should handle the case of a single DB being flushed
* but it is not worth it since anyway race conditions using the same set * but it is not worth it since anyway race conditions using the same set
* of key names in a wriatable slave and in its master will lead to * of key names in a writable slave and in its master will lead to
* inconsistencies. This is just a best-effort thing we do. */ * inconsistencies. This is just a best-effort thing we do. */
void flushSlaveKeysWithExpireList(void) { void flushSlaveKeysWithExpireList(void) {
if (slaveKeysWithExpire) { if (slaveKeysWithExpire) {
...@@ -490,7 +490,7 @@ int checkAlreadyExpired(long long when) { ...@@ -490,7 +490,7 @@ int checkAlreadyExpired(long long when) {
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/
/* This is the generic command implementation for EXPIRE, PEXPIRE, EXPIREAT /* This is the generic command implementation for EXPIRE, PEXPIRE, EXPIREAT
* and PEXPIREAT. Because the commad second argument may be relative or absolute * and PEXPIREAT. Because the command second argument may be relative or absolute
* the "basetime" argument is used to signal what the base time is (either 0 * the "basetime" argument is used to signal what the base time is (either 0
* for *AT variants of the command, or the current time for relative expires). * for *AT variants of the command, or the current time for relative expires).
* *
......
...@@ -143,8 +143,8 @@ double extractUnitOrReply(client *c, robj *unit) { ...@@ -143,8 +143,8 @@ double extractUnitOrReply(client *c, robj *unit) {
} }
/* Input Argument Helper. /* Input Argument Helper.
* Extract the dinstance from the specified two arguments starting at 'argv' * Extract the distance from the specified two arguments starting at 'argv'
* that shouldbe in the form: <number> <unit> and return the dinstance in the * that should be in the form: <number> <unit>, and return the distance in the
* specified unit on success. *conversions is populated with the coefficient * specified unit on success. *conversions is populated with the coefficient
* to use in order to convert meters to the unit. * to use in order to convert meters to the unit.
* *
...@@ -788,7 +788,7 @@ void geoposCommand(client *c) { ...@@ -788,7 +788,7 @@ void geoposCommand(client *c) {
/* GEODIST key ele1 ele2 [unit] /* GEODIST key ele1 ele2 [unit]
* *
* Return the distance, in meters by default, otherwise accordig to "unit", * Return the distance, in meters by default, otherwise according to "unit",
* between points ele1 and ele2. If one or more elements are missing NULL * between points ele1 and ele2. If one or more elements are missing NULL
* is returned. */ * is returned. */
void geodistCommand(client *c) { void geodistCommand(client *c) {
......
...@@ -68,7 +68,7 @@ uint8_t geohashEstimateStepsByRadius(double range_meters, double lat) { ...@@ -68,7 +68,7 @@ uint8_t geohashEstimateStepsByRadius(double range_meters, double lat) {
} }
step -= 2; /* Make sure range is included in most of the base cases. */ step -= 2; /* Make sure range is included in most of the base cases. */
/* Wider range torwards the poles... Note: it is possible to do better /* Wider range towards the poles... Note: it is possible to do better
* than this approximation by computing the distance between meridians * than this approximation by computing the distance between meridians
* at this latitude, but this does the trick for now. */ * at this latitude, but this does the trick for now. */
if (lat > 66 || lat < -66) { if (lat > 66 || lat < -66) {
...@@ -84,7 +84,7 @@ uint8_t geohashEstimateStepsByRadius(double range_meters, double lat) { ...@@ -84,7 +84,7 @@ uint8_t geohashEstimateStepsByRadius(double range_meters, double lat) {
/* Return the bounding box of the search area centered at latitude,longitude /* Return the bounding box of the search area centered at latitude,longitude
* having a radius of radius_meter. bounds[0] - bounds[2] is the minimum * having a radius of radius_meter. bounds[0] - bounds[2] is the minimum
* and maxium longitude, while bounds[1] - bounds[3] is the minimum and * and maximum longitude, while bounds[1] - bounds[3] is the minimum and
* maximum latitude. * maximum latitude.
* *
* This function does not behave correctly with very large radius values, for * This function does not behave correctly with very large radius values, for
......
...@@ -36,9 +36,9 @@ ...@@ -36,9 +36,9 @@
/* The Redis HyperLogLog implementation is based on the following ideas: /* The Redis HyperLogLog implementation is based on the following ideas:
* *
* * The use of a 64 bit hash function as proposed in [1], in order to don't * * The use of a 64 bit hash function as proposed in [1], in order to estimate
* limited to cardinalities up to 10^9, at the cost of just 1 additional * cardinalities larger than 10^9, at the cost of just 1 additional bit per
* bit per register. * register.
* * The use of 16384 6-bit registers for a great level of accuracy, using * * The use of 16384 6-bit registers for a great level of accuracy, using
* a total of 12k per key. * a total of 12k per key.
* * The use of the Redis string data type. No new type is introduced. * * The use of the Redis string data type. No new type is introduced.
...@@ -279,7 +279,7 @@ static char *invalid_hll_err = "-INVALIDOBJ Corrupted HLL object detected\r\n"; ...@@ -279,7 +279,7 @@ static char *invalid_hll_err = "-INVALIDOBJ Corrupted HLL object detected\r\n";
* So we right shift of 0 bits (no shift in practice) and * So we right shift of 0 bits (no shift in practice) and
* left shift the next byte of 8 bits, even if we don't use it, * left shift the next byte of 8 bits, even if we don't use it,
* but this has the effect of clearing the bits so the result * but this has the effect of clearing the bits so the result
* will not be affacted after the OR. * will not be affected after the OR.
* *
* ------------------------------------------------------------------------- * -------------------------------------------------------------------------
* *
...@@ -297,7 +297,7 @@ static char *invalid_hll_err = "-INVALIDOBJ Corrupted HLL object detected\r\n"; ...@@ -297,7 +297,7 @@ static char *invalid_hll_err = "-INVALIDOBJ Corrupted HLL object detected\r\n";
* |11000000| <- Our byte at b0 * |11000000| <- Our byte at b0
* +--------+ * +--------+
* *
* To create a AND-mask to clear the bits about this position, we just * To create an AND-mask to clear the bits about this position, we just
* initialize the mask with the value 63, left shift it of "fs" bits, * initialize the mask with the value 63, left shift it of "fs" bits,
* and finally invert the result. * and finally invert the result.
* *
...@@ -766,7 +766,7 @@ int hllSparseSet(robj *o, long index, uint8_t count) { ...@@ -766,7 +766,7 @@ int hllSparseSet(robj *o, long index, uint8_t count) {
* by a ZERO opcode with len > 1, or by an XZERO opcode. * by a ZERO opcode with len > 1, or by an XZERO opcode.
* *
* In those cases the original opcode must be split into multiple * In those cases the original opcode must be split into multiple
* opcodes. The worst case is an XZERO split in the middle resuling into * opcodes. The worst case is an XZERO split in the middle resulting into
* XZERO - VAL - XZERO, so the resulting sequence max length is * XZERO - VAL - XZERO, so the resulting sequence max length is
* 5 bytes. * 5 bytes.
* *
...@@ -899,7 +899,7 @@ promote: /* Promote to dense representation. */ ...@@ -899,7 +899,7 @@ promote: /* Promote to dense representation. */
* the element belongs to is incremented if needed. * the element belongs to is incremented if needed.
* *
* This function is actually a wrapper for hllSparseSet(), it only performs * This function is actually a wrapper for hllSparseSet(), it only performs
* the hashshing of the elmenet to obtain the index and zeros run length. */ * the hashshing of the element to obtain the index and zeros run length. */
int hllSparseAdd(robj *o, unsigned char *ele, size_t elesize) { int hllSparseAdd(robj *o, unsigned char *ele, size_t elesize) {
long index; long index;
uint8_t count = hllPatLen(ele,elesize,&index); uint8_t count = hllPatLen(ele,elesize,&index);
...@@ -1014,7 +1014,7 @@ uint64_t hllCount(struct hllhdr *hdr, int *invalid) { ...@@ -1014,7 +1014,7 @@ uint64_t hllCount(struct hllhdr *hdr, int *invalid) {
double m = HLL_REGISTERS; double m = HLL_REGISTERS;
double E; double E;
int j; int j;
/* Note that reghisto size could be just HLL_Q+2, becuase HLL_Q+1 is /* Note that reghisto size could be just HLL_Q+2, because HLL_Q+1 is
* the maximum frequency of the "000...1" sequence the hash function is * the maximum frequency of the "000...1" sequence the hash function is
* able to return. However it is slow to check for sanity of the * able to return. However it is slow to check for sanity of the
* input: instead we history array at a safe size: overflows will * input: instead we history array at a safe size: overflows will
......
...@@ -85,7 +85,7 @@ int THPGetAnonHugePagesSize(void) { ...@@ -85,7 +85,7 @@ int THPGetAnonHugePagesSize(void) {
/* ---------------------------- Latency API --------------------------------- */ /* ---------------------------- Latency API --------------------------------- */
/* Latency monitor initialization. We just need to create the dictionary /* Latency monitor initialization. We just need to create the dictionary
* of time series, each time serie is created on demand in order to avoid * of time series, each time series is created on demand in order to avoid
* having a fixed list to maintain. */ * having a fixed list to maintain. */
void latencyMonitorInit(void) { void latencyMonitorInit(void) {
server.latency_events = dictCreate(&latencyTimeSeriesDictType,NULL); server.latency_events = dictCreate(&latencyTimeSeriesDictType,NULL);
...@@ -154,7 +154,7 @@ int latencyResetEvent(char *event_to_reset) { ...@@ -154,7 +154,7 @@ int latencyResetEvent(char *event_to_reset) {
/* Analyze the samples available for a given event and return a structure /* Analyze the samples available for a given event and return a structure
* populate with different metrics, average, MAD, min, max, and so forth. * populate with different metrics, average, MAD, min, max, and so forth.
* Check latency.h definition of struct latenctStat for more info. * Check latency.h definition of struct latencyStats for more info.
* If the specified event has no elements the structure is populate with * If the specified event has no elements the structure is populate with
* zero values. */ * zero values. */
void analyzeLatencyForEvent(char *event, struct latencyStats *ls) { void analyzeLatencyForEvent(char *event, struct latencyStats *ls) {
...@@ -343,7 +343,7 @@ sds createLatencyReport(void) { ...@@ -343,7 +343,7 @@ sds createLatencyReport(void) {
} }
if (!strcasecmp(event,"aof-fstat") || if (!strcasecmp(event,"aof-fstat") ||
!strcasecmp(event,"rdb-unlik-temp-file")) { !strcasecmp(event,"rdb-unlink-temp-file")) {
advise_disk_contention = 1; advise_disk_contention = 1;
advise_local_disk = 1; advise_local_disk = 1;
advices += 2; advices += 2;
...@@ -396,7 +396,7 @@ sds createLatencyReport(void) { ...@@ -396,7 +396,7 @@ sds createLatencyReport(void) {
/* Better VM. */ /* Better VM. */
report = sdscat(report,"\nI have a few advices for you:\n\n"); report = sdscat(report,"\nI have a few advices for you:\n\n");
if (advise_better_vm) { if (advise_better_vm) {
report = sdscat(report,"- If you are using a virtual machine, consider upgrading it with a faster one using an hypervisior that provides less latency during fork() calls. Xen is known to have poor fork() performance. Even in the context of the same VM provider, certain kinds of instances can execute fork faster than others.\n"); report = sdscat(report,"- If you are using a virtual machine, consider upgrading it with a faster one using a hypervisior that provides less latency during fork() calls. Xen is known to have poor fork() performance. Even in the context of the same VM provider, certain kinds of instances can execute fork faster than others.\n");
} }
/* Slow log. */ /* Slow log. */
...@@ -416,7 +416,7 @@ sds createLatencyReport(void) { ...@@ -416,7 +416,7 @@ sds createLatencyReport(void) {
if (advise_scheduler) { if (advise_scheduler) {
report = sdscat(report,"- The system is slow to execute Redis code paths not containing system calls. This usually means the system does not provide Redis CPU time to run for long periods. You should try to:\n" report = sdscat(report,"- The system is slow to execute Redis code paths not containing system calls. This usually means the system does not provide Redis CPU time to run for long periods. You should try to:\n"
" 1) Lower the system load.\n" " 1) Lower the system load.\n"
" 2) Use a computer / VM just for Redis if you are running other softawre in the same system.\n" " 2) Use a computer / VM just for Redis if you are running other software in the same system.\n"
" 3) Check if you have a \"noisy neighbour\" problem.\n" " 3) Check if you have a \"noisy neighbour\" problem.\n"
" 4) Check with 'redis-cli --intrinsic-latency 100' what is the intrinsic latency in your system.\n" " 4) Check with 'redis-cli --intrinsic-latency 100' what is the intrinsic latency in your system.\n"
" 5) Check if the problem is allocator-related by recompiling Redis with MALLOC=libc, if you are using Jemalloc. However this may create fragmentation problems.\n"); " 5) Check if the problem is allocator-related by recompiling Redis with MALLOC=libc, if you are using Jemalloc. However this may create fragmentation problems.\n");
...@@ -432,7 +432,7 @@ sds createLatencyReport(void) { ...@@ -432,7 +432,7 @@ sds createLatencyReport(void) {
} }
if (advise_data_writeback) { if (advise_data_writeback) {
report = sdscat(report,"- Mounting ext3/4 filesystems with data=writeback can provide a performance boost compared to data=ordered, however this mode of operation provides less guarantees, and sometimes it can happen that after a hard crash the AOF file will have an half-written command at the end and will require to be repaired before Redis restarts.\n"); report = sdscat(report,"- Mounting ext3/4 filesystems with data=writeback can provide a performance boost compared to data=ordered, however this mode of operation provides less guarantees, and sometimes it can happen that after a hard crash the AOF file will have a half-written command at the end and will require to be repaired before Redis restarts.\n");
} }
if (advise_disk_contention) { if (advise_disk_contention) {
......
...@@ -15,7 +15,7 @@ size_t lazyfreeGetPendingObjectsCount(void) { ...@@ -15,7 +15,7 @@ size_t lazyfreeGetPendingObjectsCount(void) {
/* Return the amount of work needed in order to free an object. /* Return the amount of work needed in order to free an object.
* The return value is not always the actual number of allocations the * The return value is not always the actual number of allocations the
* object is compoesd of, but a number proportional to it. * object is composed of, but a number proportional to it.
* *
* For strings the function always returns 1. * For strings the function always returns 1.
* *
...@@ -137,7 +137,7 @@ void emptyDbAsync(redisDb *db) { ...@@ -137,7 +137,7 @@ void emptyDbAsync(redisDb *db) {
} }
/* Empty the slots-keys map of Redis CLuster by creating a new empty one /* Empty the slots-keys map of Redis CLuster by creating a new empty one
* and scheduiling the old for lazy freeing. */ * and scheduling the old for lazy freeing. */
void slotToKeyFlushAsync(void) { void slotToKeyFlushAsync(void) {
rax *old = server.cluster->slots_to_keys; rax *old = server.cluster->slots_to_keys;
...@@ -156,7 +156,7 @@ void lazyfreeFreeObjectFromBioThread(robj *o) { ...@@ -156,7 +156,7 @@ void lazyfreeFreeObjectFromBioThread(robj *o) {
} }
/* Release a database from the lazyfree thread. The 'db' pointer is the /* Release a database from the lazyfree thread. The 'db' pointer is the
* database which was substitutied with a fresh one in the main thread * database which was substituted with a fresh one in the main thread
* when the database was logically deleted. 'sl' is a skiplist used by * when the database was logically deleted. 'sl' is a skiplist used by
* Redis Cluster in order to take the hash slots -> keys mapping. This * Redis Cluster in order to take the hash slots -> keys mapping. This
* may be NULL if Redis Cluster is disabled. */ * may be NULL if Redis Cluster is disabled. */
......
...@@ -405,7 +405,7 @@ unsigned char *lpNext(unsigned char *lp, unsigned char *p) { ...@@ -405,7 +405,7 @@ unsigned char *lpNext(unsigned char *lp, unsigned char *p) {
} }
/* If 'p' points to an element of the listpack, calling lpPrev() will return /* If 'p' points to an element of the listpack, calling lpPrev() will return
* the pointer to the preivous element (the one on the left), or NULL if 'p' * the pointer to the previous element (the one on the left), or NULL if 'p'
* already pointed to the first element of the listpack. */ * already pointed to the first element of the listpack. */
unsigned char *lpPrev(unsigned char *lp, unsigned char *p) { unsigned char *lpPrev(unsigned char *lp, unsigned char *p) {
if (p-lp == LP_HDR_SIZE) return NULL; if (p-lp == LP_HDR_SIZE) return NULL;
......
...@@ -85,7 +85,7 @@ void lolwutCommand(client *c) { ...@@ -85,7 +85,7 @@ void lolwutCommand(client *c) {
} }
/* ========================== LOLWUT Canvase =============================== /* ========================== LOLWUT Canvase ===============================
* Many LOWUT versions will likely print some computer art to the screen. * Many LOLWUT versions will likely print some computer art to the screen.
* This is the case with LOLWUT 5 and LOLWUT 6, so here there is a generic * This is the case with LOLWUT 5 and LOLWUT 6, so here there is a generic
* canvas implementation that can be reused. */ * canvas implementation that can be reused. */
...@@ -106,7 +106,7 @@ void lwFreeCanvas(lwCanvas *canvas) { ...@@ -106,7 +106,7 @@ void lwFreeCanvas(lwCanvas *canvas) {
} }
/* Set a pixel to the specified color. Color is 0 or 1, where zero means no /* Set a pixel to the specified color. Color is 0 or 1, where zero means no
* dot will be displyed, and 1 means dot will be displayed. * dot will be displayed, and 1 means dot will be displayed.
* Coordinates are arranged so that left-top corner is 0,0. You can write * Coordinates are arranged so that left-top corner is 0,0. You can write
* out of the size of the canvas without issues. */ * out of the size of the canvas without issues. */
void lwDrawPixel(lwCanvas *canvas, int x, int y, int color) { void lwDrawPixel(lwCanvas *canvas, int x, int y, int color) {
......
...@@ -156,7 +156,7 @@ void lolwut5Command(client *c) { ...@@ -156,7 +156,7 @@ void lolwut5Command(client *c) {
return; return;
/* Limits. We want LOLWUT to be always reasonably fast and cheap to execute /* Limits. We want LOLWUT to be always reasonably fast and cheap to execute
* so we have maximum number of columns, rows, and output resulution. */ * so we have maximum number of columns, rows, and output resolution. */
if (cols < 1) cols = 1; if (cols < 1) cols = 1;
if (cols > 1000) cols = 1000; if (cols > 1000) cols = 1000;
if (squares_per_row < 1) squares_per_row = 1; if (squares_per_row < 1) squares_per_row = 1;
......
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
/* /*
* Whether to store pointers or offsets inside the hash table. On * Whether to store pointers or offsets inside the hash table. On
* 64 bit architetcures, pointers take up twice as much space, * 64 bit architectures, pointers take up twice as much space,
* and might also be slower. Default is to autodetect. * and might also be slower. Default is to autodetect.
*/ */
/*#define LZF_USER_OFFSETS autodetect */ /*#define LZF_USER_OFFSETS autodetect */
......
...@@ -46,7 +46,7 @@ typedef struct RedisModuleInfoCtx { ...@@ -46,7 +46,7 @@ typedef struct RedisModuleInfoCtx {
sds info; /* info string we collected so far */ sds info; /* info string we collected so far */
int sections; /* number of sections we collected so far */ int sections; /* number of sections we collected so far */
int in_section; /* indication if we're in an active section or not */ int in_section; /* indication if we're in an active section or not */
int in_dict_field; /* indication that we're curreintly appending to a dict */ int in_dict_field; /* indication that we're currently appending to a dict */
} RedisModuleInfoCtx; } RedisModuleInfoCtx;
typedef void (*RedisModuleInfoFunc)(RedisModuleInfoCtx *ctx, int for_crash_report); typedef void (*RedisModuleInfoFunc)(RedisModuleInfoCtx *ctx, int for_crash_report);
...@@ -906,10 +906,21 @@ int RM_SignalModifiedKey(RedisModuleCtx *ctx, RedisModuleString *keyname) { ...@@ -906,10 +906,21 @@ int RM_SignalModifiedKey(RedisModuleCtx *ctx, RedisModuleString *keyname) {
* Automatic memory management for modules * Automatic memory management for modules
* -------------------------------------------------------------------------- */ * -------------------------------------------------------------------------- */
/* Enable automatic memory management. See API.md for more information. /* Enable automatic memory management.
* *
* The function must be called as the first function of a command implementation * The function must be called as the first function of a command implementation
* that wants to use automatic memory. */ * that wants to use automatic memory.
*
* When enabled, automatic memory management tracks and automatically frees
* keys, call replies and Redis string objects once the command returns. In most
* cases this eliminates the need of calling the following functions:
*
* 1) RedisModule_CloseKey()
* 2) RedisModule_FreeCallReply()
* 3) RedisModule_FreeString()
*
* These functions can still be used with automatic memory management enabled,
* to optimize loops that make numerous allocations for example. */
void RM_AutoMemory(RedisModuleCtx *ctx) { void RM_AutoMemory(RedisModuleCtx *ctx) {
ctx->flags |= REDISMODULE_CTX_AUTO_MEMORY; ctx->flags |= REDISMODULE_CTX_AUTO_MEMORY;
} }
...@@ -1045,7 +1056,7 @@ RedisModuleString *RM_CreateStringFromLongLong(RedisModuleCtx *ctx, long long ll ...@@ -1045,7 +1056,7 @@ RedisModuleString *RM_CreateStringFromLongLong(RedisModuleCtx *ctx, long long ll
} }
/* Like RedisModule_CreatString(), but creates a string starting from a double /* Like RedisModule_CreatString(), but creates a string starting from a double
* integer instead of taking a buffer and its length. * instead of taking a buffer and its length.
* *
* The returned string must be released with RedisModule_FreeString() or by * The returned string must be released with RedisModule_FreeString() or by
* enabling automatic memory management. */ * enabling automatic memory management. */
...@@ -1922,7 +1933,7 @@ int RM_GetContextFlags(RedisModuleCtx *ctx) { ...@@ -1922,7 +1933,7 @@ int RM_GetContextFlags(RedisModuleCtx *ctx) {
flags |= REDISMODULE_CTX_FLAGS_LUA; flags |= REDISMODULE_CTX_FLAGS_LUA;
if (ctx->client->flags & CLIENT_MULTI) if (ctx->client->flags & CLIENT_MULTI)
flags |= REDISMODULE_CTX_FLAGS_MULTI; flags |= REDISMODULE_CTX_FLAGS_MULTI;
/* Module command recieved from MASTER, is replicated. */ /* Module command received from MASTER, is replicated. */
if (ctx->client->flags & CLIENT_MASTER) if (ctx->client->flags & CLIENT_MASTER)
flags |= REDISMODULE_CTX_FLAGS_REPLICATED; flags |= REDISMODULE_CTX_FLAGS_REPLICATED;
} }
...@@ -2921,7 +2932,7 @@ int RM_HashSet(RedisModuleKey *key, int flags, ...) { ...@@ -2921,7 +2932,7 @@ int RM_HashSet(RedisModuleKey *key, int flags, ...) {
/* Get fields from an hash value. This function is called using a variable /* Get fields from an hash value. This function is called using a variable
* number of arguments, alternating a field name (as a StringRedisModule * number of arguments, alternating a field name (as a StringRedisModule
* pointer) with a pointer to a StringRedisModule pointer, that is set to the * pointer) with a pointer to a StringRedisModule pointer, that is set to the
* value of the field if the field exist, or NULL if the field did not exist. * value of the field if the field exists, or NULL if the field does not exist.
* At the end of the field/value-ptr pairs, NULL must be specified as last * At the end of the field/value-ptr pairs, NULL must be specified as last
* argument to signal the end of the arguments in the variadic function. * argument to signal the end of the arguments in the variadic function.
* *
...@@ -3040,7 +3051,7 @@ void moduleParseCallReply_SimpleString(RedisModuleCallReply *reply); ...@@ -3040,7 +3051,7 @@ void moduleParseCallReply_SimpleString(RedisModuleCallReply *reply);
void moduleParseCallReply_Array(RedisModuleCallReply *reply); void moduleParseCallReply_Array(RedisModuleCallReply *reply);
/* Do nothing if REDISMODULE_REPLYFLAG_TOPARSE is false, otherwise /* Do nothing if REDISMODULE_REPLYFLAG_TOPARSE is false, otherwise
* use the protcol of the reply in reply->proto in order to fill the * use the protocol of the reply in reply->proto in order to fill the
* reply with parsed data according to the reply type. */ * reply with parsed data according to the reply type. */
void moduleParseCallReply(RedisModuleCallReply *reply) { void moduleParseCallReply(RedisModuleCallReply *reply) {
if (!(reply->flags & REDISMODULE_REPLYFLAG_TOPARSE)) return; if (!(reply->flags & REDISMODULE_REPLYFLAG_TOPARSE)) return;
...@@ -3599,7 +3610,7 @@ void moduleTypeNameByID(char *name, uint64_t moduleid) { ...@@ -3599,7 +3610,7 @@ void moduleTypeNameByID(char *name, uint64_t moduleid) {
/* Register a new data type exported by the module. The parameters are the /* Register a new data type exported by the module. The parameters are the
* following. Please for in depth documentation check the modules API * following. Please for in depth documentation check the modules API
* documentation, especially the TYPES.md file. * documentation, especially https://redis.io/topics/modules-native-types.
* *
* * **name**: A 9 characters data type name that MUST be unique in the Redis * * **name**: A 9 characters data type name that MUST be unique in the Redis
* Modules ecosystem. Be creative... and there will be no collisions. Use * Modules ecosystem. Be creative... and there will be no collisions. Use
...@@ -3646,7 +3657,7 @@ void moduleTypeNameByID(char *name, uint64_t moduleid) { ...@@ -3646,7 +3657,7 @@ void moduleTypeNameByID(char *name, uint64_t moduleid) {
* * **aux_load**: A callback function pointer that loads out of keyspace data from RDB files. * * **aux_load**: A callback function pointer that loads out of keyspace data from RDB files.
* Similar to aux_save, returns REDISMODULE_OK on success, and ERR otherwise. * Similar to aux_save, returns REDISMODULE_OK on success, and ERR otherwise.
* *
* The **digest* and **mem_usage** methods should currently be omitted since * The **digest** and **mem_usage** methods should currently be omitted since
* they are not yet implemented inside the Redis modules core. * they are not yet implemented inside the Redis modules core.
* *
* Note: the module name "AAAAAAAAA" is reserved and produces an error, it * Note: the module name "AAAAAAAAA" is reserved and produces an error, it
...@@ -3656,7 +3667,7 @@ void moduleTypeNameByID(char *name, uint64_t moduleid) { ...@@ -3656,7 +3667,7 @@ void moduleTypeNameByID(char *name, uint64_t moduleid) {
* and if the module name or encver is invalid, NULL is returned. * and if the module name or encver is invalid, NULL is returned.
* Otherwise the new type is registered into Redis, and a reference of * Otherwise the new type is registered into Redis, and a reference of
* type RedisModuleType is returned: the caller of the function should store * type RedisModuleType is returned: the caller of the function should store
* this reference into a gobal variable to make future use of it in the * this reference into a global variable to make future use of it in the
* modules type API, since a single module may register multiple types. * modules type API, since a single module may register multiple types.
* Example code fragment: * Example code fragment:
* *
...@@ -3738,7 +3749,7 @@ moduleType *RM_ModuleTypeGetType(RedisModuleKey *key) { ...@@ -3738,7 +3749,7 @@ moduleType *RM_ModuleTypeGetType(RedisModuleKey *key) {
/* Assuming RedisModule_KeyType() returned REDISMODULE_KEYTYPE_MODULE on /* Assuming RedisModule_KeyType() returned REDISMODULE_KEYTYPE_MODULE on
* the key, returns the module type low-level value stored at key, as * the key, returns the module type low-level value stored at key, as
* it was set by the user via RedisModule_ModuleTypeSet(). * it was set by the user via RedisModule_ModuleTypeSetValue().
* *
* If the key is NULL, is not associated with a module type, or is empty, * If the key is NULL, is not associated with a module type, or is empty,
* then NULL is returned instead. */ * then NULL is returned instead. */
...@@ -3795,7 +3806,7 @@ int moduleAllDatatypesHandleErrors() { ...@@ -3795,7 +3806,7 @@ int moduleAllDatatypesHandleErrors() {
/* Returns true if any previous IO API failed. /* Returns true if any previous IO API failed.
* for Load* APIs the REDISMODULE_OPTIONS_HANDLE_IO_ERRORS flag must be set with * for Load* APIs the REDISMODULE_OPTIONS_HANDLE_IO_ERRORS flag must be set with
* RediModule_SetModuleOptions first. */ * RedisModule_SetModuleOptions first. */
int RM_IsIOError(RedisModuleIO *io) { int RM_IsIOError(RedisModuleIO *io) {
return io->error; return io->error;
} }
...@@ -3928,7 +3939,7 @@ RedisModuleString *RM_LoadString(RedisModuleIO *io) { ...@@ -3928,7 +3939,7 @@ RedisModuleString *RM_LoadString(RedisModuleIO *io) {
* *
* The size of the string is stored at '*lenptr' if not NULL. * The size of the string is stored at '*lenptr' if not NULL.
* The returned string is not automatically NULL terminated, it is loaded * The returned string is not automatically NULL terminated, it is loaded
* exactly as it was stored inisde the RDB file. */ * exactly as it was stored inside the RDB file. */
char *RM_LoadStringBuffer(RedisModuleIO *io, size_t *lenptr) { char *RM_LoadStringBuffer(RedisModuleIO *io, size_t *lenptr) {
return moduleLoadString(io,1,lenptr); return moduleLoadString(io,1,lenptr);
} }
...@@ -4520,7 +4531,7 @@ int moduleTryServeClientBlockedOnKey(client *c, robj *key) { ...@@ -4520,7 +4531,7 @@ int moduleTryServeClientBlockedOnKey(client *c, robj *key) {
* reply_callback: called after a successful RedisModule_UnblockClient() * reply_callback: called after a successful RedisModule_UnblockClient()
* call in order to reply to the client and unblock it. * call in order to reply to the client and unblock it.
* *
* reply_timeout: called when the timeout is reached in order to send an * timeout_callback: called when the timeout is reached in order to send an
* error to the client. * error to the client.
* *
* free_privdata: called in order to free the private data that is passed * free_privdata: called in order to free the private data that is passed
...@@ -4547,13 +4558,13 @@ RedisModuleBlockedClient *RM_BlockClient(RedisModuleCtx *ctx, RedisModuleCmdFunc ...@@ -4547,13 +4558,13 @@ RedisModuleBlockedClient *RM_BlockClient(RedisModuleCtx *ctx, RedisModuleCmdFunc
* once certain keys become "ready", that is, contain more data. * once certain keys become "ready", that is, contain more data.
* *
* Basically this is similar to what a typical Redis command usually does, * Basically this is similar to what a typical Redis command usually does,
* like BLPOP or ZPOPMAX: the client blocks if it cannot be served ASAP, * like BLPOP or BZPOPMAX: the client blocks if it cannot be served ASAP,
* and later when the key receives new data (a list push for instance), the * and later when the key receives new data (a list push for instance), the
* client is unblocked and served. * client is unblocked and served.
* *
* However in the case of this module API, when the client is unblocked? * However in the case of this module API, when the client is unblocked?
* *
* 1. If you block ok a key of a type that has blocking operations associated, * 1. If you block on a key of a type that has blocking operations associated,
* like a list, a sorted set, a stream, and so forth, the client may be * like a list, a sorted set, a stream, and so forth, the client may be
* unblocked once the relevant key is targeted by an operation that normally * unblocked once the relevant key is targeted by an operation that normally
* unblocks the native blocking operations for that type. So if we block * unblocks the native blocking operations for that type. So if we block
...@@ -4948,7 +4959,7 @@ void moduleReleaseGIL(void) { ...@@ -4948,7 +4959,7 @@ void moduleReleaseGIL(void) {
/* Subscribe to keyspace notifications. This is a low-level version of the /* Subscribe to keyspace notifications. This is a low-level version of the
* keyspace-notifications API. A module can register callbacks to be notified * keyspace-notifications API. A module can register callbacks to be notified
* when keyspce events occur. * when keyspace events occur.
* *
* Notification events are filtered by their type (string events, set events, * Notification events are filtered by their type (string events, set events,
* etc), and the subscriber callback receives only events that match a specific * etc), and the subscriber callback receives only events that match a specific
...@@ -5659,7 +5670,7 @@ int RM_AuthenticateClientWithACLUser(RedisModuleCtx *ctx, const char *name, size ...@@ -5659,7 +5670,7 @@ int RM_AuthenticateClientWithACLUser(RedisModuleCtx *ctx, const char *name, size
/* Deauthenticate and close the client. The client resources will not be /* Deauthenticate and close the client. The client resources will not be
* be immediately freed, but will be cleaned up in a background job. This is * be immediately freed, but will be cleaned up in a background job. This is
* the recommended way to deauthenicate a client since most clients can't * the recommended way to deauthenicate a client since most clients can't
* handle users becomming deauthenticated. Returns REDISMODULE_ERR when the * handle users becoming deauthenticated. Returns REDISMODULE_ERR when the
* client doesn't exist and REDISMODULE_OK when the operation was successful. * client doesn't exist and REDISMODULE_OK when the operation was successful.
* *
* The client ID is returned from the RM_AuthenticateClientWithUser and * The client ID is returned from the RM_AuthenticateClientWithUser and
...@@ -5779,14 +5790,14 @@ int RM_DictDel(RedisModuleDict *d, RedisModuleString *key, void *oldval) { ...@@ -5779,14 +5790,14 @@ int RM_DictDel(RedisModuleDict *d, RedisModuleString *key, void *oldval) {
return RM_DictDelC(d,key->ptr,sdslen(key->ptr),oldval); return RM_DictDelC(d,key->ptr,sdslen(key->ptr),oldval);
} }
/* Return an interator, setup in order to start iterating from the specified /* Return an iterator, setup in order to start iterating from the specified
* key by applying the operator 'op', which is just a string specifying the * key by applying the operator 'op', which is just a string specifying the
* comparison operator to use in order to seek the first element. The * comparison operator to use in order to seek the first element. The
* operators avalable are: * operators available are:
* *
* "^" -- Seek the first (lexicographically smaller) key. * "^" -- Seek the first (lexicographically smaller) key.
* "$" -- Seek the last (lexicographically biffer) key. * "$" -- Seek the last (lexicographically biffer) key.
* ">" -- Seek the first element greter than the specified key. * ">" -- Seek the first element greater than the specified key.
* ">=" -- Seek the first element greater or equal than the specified key. * ">=" -- Seek the first element greater or equal than the specified key.
* "<" -- Seek the first element smaller than the specified key. * "<" -- Seek the first element smaller than the specified key.
* "<=" -- Seek the first element smaller or equal than the specified key. * "<=" -- Seek the first element smaller or equal than the specified key.
...@@ -5913,7 +5924,7 @@ RedisModuleString *RM_DictPrev(RedisModuleCtx *ctx, RedisModuleDictIter *di, voi ...@@ -5913,7 +5924,7 @@ RedisModuleString *RM_DictPrev(RedisModuleCtx *ctx, RedisModuleDictIter *di, voi
* in the loop, as we iterate elements, we can also check if we are still * in the loop, as we iterate elements, we can also check if we are still
* on range. * on range.
* *
* The function returne REDISMODULE_ERR if the iterator reached the * The function return REDISMODULE_ERR if the iterator reached the
* end of elements condition as well. */ * end of elements condition as well. */
int RM_DictCompareC(RedisModuleDictIter *di, const char *op, void *key, size_t keylen) { int RM_DictCompareC(RedisModuleDictIter *di, const char *op, void *key, size_t keylen) {
if (raxEOF(&di->ri)) return REDISMODULE_ERR; if (raxEOF(&di->ri)) return REDISMODULE_ERR;
...@@ -6294,7 +6305,7 @@ int RM_ExportSharedAPI(RedisModuleCtx *ctx, const char *apiname, void *func) { ...@@ -6294,7 +6305,7 @@ int RM_ExportSharedAPI(RedisModuleCtx *ctx, const char *apiname, void *func) {
* command that requires external APIs: if some API cannot be resolved, the * command that requires external APIs: if some API cannot be resolved, the
* command should return an error. * command should return an error.
* *
* Here is an exmaple: * Here is an example:
* *
* int ... myCommandImplementation() { * int ... myCommandImplementation() {
* if (getExternalAPIs() == 0) { * if (getExternalAPIs() == 0) {
...@@ -6680,7 +6691,7 @@ void RM_ScanCursorDestroy(RedisModuleScanCursor *cursor) { ...@@ -6680,7 +6691,7 @@ void RM_ScanCursorDestroy(RedisModuleScanCursor *cursor) {
* RedisModule_ScanCursorDestroy(c); * RedisModule_ScanCursorDestroy(c);
* *
* It is also possible to use this API from another thread while the lock * It is also possible to use this API from another thread while the lock
* is acquired durring the actuall call to RM_Scan: * is acquired during the actuall call to RM_Scan:
* *
* RedisModuleCursor *c = RedisModule_ScanCursorCreate(); * RedisModuleCursor *c = RedisModule_ScanCursorCreate();
* RedisModule_ThreadSafeContextLock(ctx); * RedisModule_ThreadSafeContextLock(ctx);
...@@ -6694,7 +6705,7 @@ void RM_ScanCursorDestroy(RedisModuleScanCursor *cursor) { ...@@ -6694,7 +6705,7 @@ void RM_ScanCursorDestroy(RedisModuleScanCursor *cursor) {
* The function will return 1 if there are more elements to scan and * The function will return 1 if there are more elements to scan and
* 0 otherwise, possibly setting errno if the call failed. * 0 otherwise, possibly setting errno if the call failed.
* *
* It is also possible to restart and existing cursor using RM_CursorRestart. * It is also possible to restart an existing cursor using RM_ScanCursorRestart.
* *
* IMPORTANT: This API is very similar to the Redis SCAN command from the * IMPORTANT: This API is very similar to the Redis SCAN command from the
* point of view of the guarantees it provides. This means that the API * point of view of the guarantees it provides. This means that the API
...@@ -6708,7 +6719,7 @@ void RM_ScanCursorDestroy(RedisModuleScanCursor *cursor) { ...@@ -6708,7 +6719,7 @@ void RM_ScanCursorDestroy(RedisModuleScanCursor *cursor) {
* Moreover playing with the Redis keyspace while iterating may have the * Moreover playing with the Redis keyspace while iterating may have the
* effect of returning more duplicates. A safe pattern is to store the keys * effect of returning more duplicates. A safe pattern is to store the keys
* names you want to modify elsewhere, and perform the actions on the keys * names you want to modify elsewhere, and perform the actions on the keys
* later when the iteration is complete. Howerver this can cost a lot of * later when the iteration is complete. However this can cost a lot of
* memory, so it may make sense to just operate on the current key when * memory, so it may make sense to just operate on the current key when
* possible during the iteration, given that this is safe. */ * possible during the iteration, given that this is safe. */
int RM_Scan(RedisModuleCtx *ctx, RedisModuleScanCursor *cursor, RedisModuleScanCB fn, void *privdata) { int RM_Scan(RedisModuleCtx *ctx, RedisModuleScanCursor *cursor, RedisModuleScanCB fn, void *privdata) {
...@@ -6773,8 +6784,8 @@ static void moduleScanKeyCallback(void *privdata, const dictEntry *de) { ...@@ -6773,8 +6784,8 @@ static void moduleScanKeyCallback(void *privdata, const dictEntry *de) {
* RedisModule_CloseKey(key); * RedisModule_CloseKey(key);
* RedisModule_ScanCursorDestroy(c); * RedisModule_ScanCursorDestroy(c);
* *
* It is also possible to use this API from another thread while the lock is acquired durring * It is also possible to use this API from another thread while the lock is acquired during
* the actuall call to RM_Scan, and re-opening the key each time: * the actuall call to RM_ScanKey, and re-opening the key each time:
* RedisModuleCursor *c = RedisModule_ScanCursorCreate(); * RedisModuleCursor *c = RedisModule_ScanCursorCreate();
* RedisModule_ThreadSafeContextLock(ctx); * RedisModule_ThreadSafeContextLock(ctx);
* RedisModuleKey *key = RedisModule_OpenKey(...) * RedisModuleKey *key = RedisModule_OpenKey(...)
...@@ -6790,7 +6801,7 @@ static void moduleScanKeyCallback(void *privdata, const dictEntry *de) { ...@@ -6790,7 +6801,7 @@ static void moduleScanKeyCallback(void *privdata, const dictEntry *de) {
* *
* The function will return 1 if there are more elements to scan and 0 otherwise, * The function will return 1 if there are more elements to scan and 0 otherwise,
* possibly setting errno if the call failed. * possibly setting errno if the call failed.
* It is also possible to restart and existing cursor using RM_CursorRestart. * It is also possible to restart an existing cursor using RM_ScanCursorRestart.
* *
* NOTE: Certain operations are unsafe while iterating the object. For instance * NOTE: Certain operations are unsafe while iterating the object. For instance
* while the API guarantees to return at least one time all the elements that * while the API guarantees to return at least one time all the elements that
...@@ -6943,7 +6954,7 @@ int TerminateModuleForkChild(int child_pid, int wait) { ...@@ -6943,7 +6954,7 @@ int TerminateModuleForkChild(int child_pid, int wait) {
} }
/* Can be used to kill the forked child process from the parent process. /* Can be used to kill the forked child process from the parent process.
* child_pid whould be the return value of RedisModule_Fork. */ * child_pid would be the return value of RedisModule_Fork. */
int RM_KillForkChild(int child_pid) { int RM_KillForkChild(int child_pid) {
/* Kill module child, wait for child exit. */ /* Kill module child, wait for child exit. */
if (TerminateModuleForkChild(child_pid,1) == C_OK) if (TerminateModuleForkChild(child_pid,1) == C_OK)
...@@ -7081,7 +7092,7 @@ void ModuleForkDoneHandler(int exitcode, int bysignal) { ...@@ -7081,7 +7092,7 @@ void ModuleForkDoneHandler(int exitcode, int bysignal) {
* REDISMODULE_SUBEVENT_LOADING_FAILED * REDISMODULE_SUBEVENT_LOADING_FAILED
* *
* Note that AOF loading may start with an RDB data in case of * Note that AOF loading may start with an RDB data in case of
* rdb-preamble, in which case you'll only recieve an AOF_START event. * rdb-preamble, in which case you'll only receive an AOF_START event.
* *
* *
* RedisModuleEvent_ClientChange * RedisModuleEvent_ClientChange
...@@ -7103,7 +7114,7 @@ void ModuleForkDoneHandler(int exitcode, int bysignal) { ...@@ -7103,7 +7114,7 @@ void ModuleForkDoneHandler(int exitcode, int bysignal) {
* This event is called when the instance (that can be both a * This event is called when the instance (that can be both a
* master or a replica) get a new online replica, or lose a * master or a replica) get a new online replica, or lose a
* replica since it gets disconnected. * replica since it gets disconnected.
* The following sub events are availble: * The following sub events are available:
* *
* REDISMODULE_SUBEVENT_REPLICA_CHANGE_ONLINE * REDISMODULE_SUBEVENT_REPLICA_CHANGE_ONLINE
* REDISMODULE_SUBEVENT_REPLICA_CHANGE_OFFLINE * REDISMODULE_SUBEVENT_REPLICA_CHANGE_OFFLINE
...@@ -7141,7 +7152,7 @@ void ModuleForkDoneHandler(int exitcode, int bysignal) { ...@@ -7141,7 +7152,7 @@ void ModuleForkDoneHandler(int exitcode, int bysignal) {
* RedisModuleEvent_ModuleChange * RedisModuleEvent_ModuleChange
* *
* This event is called when a new module is loaded or one is unloaded. * This event is called when a new module is loaded or one is unloaded.
* The following sub events are availble: * The following sub events are available:
* *
* REDISMODULE_SUBEVENT_MODULE_LOADED * REDISMODULE_SUBEVENT_MODULE_LOADED
* REDISMODULE_SUBEVENT_MODULE_UNLOADED * REDISMODULE_SUBEVENT_MODULE_UNLOADED
...@@ -7168,7 +7179,7 @@ void ModuleForkDoneHandler(int exitcode, int bysignal) { ...@@ -7168,7 +7179,7 @@ void ModuleForkDoneHandler(int exitcode, int bysignal) {
* int32_t progress; // Approximate progress between 0 and 1024, * int32_t progress; // Approximate progress between 0 and 1024,
* or -1 if unknown. * or -1 if unknown.
* *
* The function returns REDISMODULE_OK if the module was successfully subscrived * The function returns REDISMODULE_OK if the module was successfully subscribed
* for the specified event. If the API is called from a wrong context then * for the specified event. If the API is called from a wrong context then
* REDISMODULE_ERR is returned. */ * REDISMODULE_ERR is returned. */
int RM_SubscribeToServerEvent(RedisModuleCtx *ctx, RedisModuleEvent event, RedisModuleEventCallback callback) { int RM_SubscribeToServerEvent(RedisModuleCtx *ctx, RedisModuleEvent event, RedisModuleEventCallback callback) {
...@@ -7364,7 +7375,7 @@ void moduleInitModulesSystem(void) { ...@@ -7364,7 +7375,7 @@ void moduleInitModulesSystem(void) {
server.loadmodule_queue = listCreate(); server.loadmodule_queue = listCreate();
modules = dictCreate(&modulesDictType,NULL); modules = dictCreate(&modulesDictType,NULL);
/* Set up the keyspace notification susbscriber list and static client */ /* Set up the keyspace notification subscriber list and static client */
moduleKeyspaceSubscribers = listCreate(); moduleKeyspaceSubscribers = listCreate();
moduleFreeContextReusedClient = createClient(NULL); moduleFreeContextReusedClient = createClient(NULL);
moduleFreeContextReusedClient->flags |= CLIENT_MODULE; moduleFreeContextReusedClient->flags |= CLIENT_MODULE;
...@@ -7728,7 +7739,7 @@ size_t moduleCount(void) { ...@@ -7728,7 +7739,7 @@ size_t moduleCount(void) {
return dictSize(modules); return dictSize(modules);
} }
/* Set the key last access time for LRU based eviction. not relevent if the /* Set the key last access time for LRU based eviction. not relevant if the
* servers's maxmemory policy is LFU based. Value is idle time in milliseconds. * servers's maxmemory policy is LFU based. Value is idle time in milliseconds.
* returns REDISMODULE_OK if the LRU was updated, REDISMODULE_ERR otherwise. */ * returns REDISMODULE_OK if the LRU was updated, REDISMODULE_ERR otherwise. */
int RM_SetLRU(RedisModuleKey *key, mstime_t lru_idle) { int RM_SetLRU(RedisModuleKey *key, mstime_t lru_idle) {
......
...@@ -125,7 +125,7 @@ int RedisModule_OnLoad(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) ...@@ -125,7 +125,7 @@ int RedisModule_OnLoad(RedisModuleCtx *ctx, RedisModuleString **argv, int argc)
cmd_KEYRANGE,"readonly",1,1,0) == REDISMODULE_ERR) cmd_KEYRANGE,"readonly",1,1,0) == REDISMODULE_ERR)
return REDISMODULE_ERR; return REDISMODULE_ERR;
/* Create our global dictionray. Here we'll set our keys and values. */ /* Create our global dictionary. Here we'll set our keys and values. */
Keyspace = RedisModule_CreateDict(NULL); Keyspace = RedisModule_CreateDict(NULL);
return REDISMODULE_OK; return REDISMODULE_OK;
......
...@@ -91,7 +91,7 @@ int HelloPushCall_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, in ...@@ -91,7 +91,7 @@ int HelloPushCall_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, in
} }
/* HELLO.PUSH.CALL2 /* HELLO.PUSH.CALL2
* This is exaxctly as HELLO.PUSH.CALL, but shows how we can reply to the * This is exactly as HELLO.PUSH.CALL, but shows how we can reply to the
* client using directly a reply object that Call() returned. */ * client using directly a reply object that Call() returned. */
int HelloPushCall2_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) int HelloPushCall2_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int argc)
{ {
...@@ -345,7 +345,7 @@ int HelloToggleCase_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, ...@@ -345,7 +345,7 @@ int HelloToggleCase_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv,
/* HELLO.MORE.EXPIRE key milliseconds. /* HELLO.MORE.EXPIRE key milliseconds.
* *
* If they key has already an associated TTL, extends it by "milliseconds" * If the key has already an associated TTL, extends it by "milliseconds"
* milliseconds. Otherwise no operation is performed. */ * milliseconds. Otherwise no operation is performed. */
int HelloMoreExpire_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) { int HelloMoreExpire_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
RedisModule_AutoMemory(ctx); /* Use automatic memory management. */ RedisModule_AutoMemory(ctx); /* Use automatic memory management. */
......
...@@ -87,7 +87,7 @@ void discardTransaction(client *c) { ...@@ -87,7 +87,7 @@ void discardTransaction(client *c) {
unwatchAllKeys(c); unwatchAllKeys(c);
} }
/* Flag the transacation as DIRTY_EXEC so that EXEC will fail. /* Flag the transaction as DIRTY_EXEC so that EXEC will fail.
* Should be called every time there is an error while queueing a command. */ * Should be called every time there is an error while queueing a command. */
void flagTransaction(client *c) { void flagTransaction(client *c) {
if (c->flags & CLIENT_MULTI) if (c->flags & CLIENT_MULTI)
......
...@@ -170,7 +170,7 @@ client *createClient(connection *conn) { ...@@ -170,7 +170,7 @@ client *createClient(connection *conn) {
return c; return c;
} }
/* This funciton puts the client in the queue of clients that should write /* This function puts the client in the queue of clients that should write
* their output buffers to the socket. Note that it does not *yet* install * their output buffers to the socket. Note that it does not *yet* install
* the write handler, to start clients are put in a queue of clients that need * the write handler, to start clients are put in a queue of clients that need
* to write, so we try to do that before returning in the event loop (see the * to write, so we try to do that before returning in the event loop (see the
...@@ -268,7 +268,7 @@ void _addReplyProtoToList(client *c, const char *s, size_t len) { ...@@ -268,7 +268,7 @@ void _addReplyProtoToList(client *c, const char *s, size_t len) {
listNode *ln = listLast(c->reply); listNode *ln = listLast(c->reply);
clientReplyBlock *tail = ln? listNodeValue(ln): NULL; clientReplyBlock *tail = ln? listNodeValue(ln): NULL;
/* Note that 'tail' may be NULL even if we have a tail node, becuase when /* Note that 'tail' may be NULL even if we have a tail node, because when
* addReplyDeferredLen() is used, it sets a dummy node to NULL just * addReplyDeferredLen() is used, it sets a dummy node to NULL just
* fo fill it later, when the size of the bulk length is set. */ * fo fill it later, when the size of the bulk length is set. */
...@@ -1161,7 +1161,7 @@ void freeClient(client *c) { ...@@ -1161,7 +1161,7 @@ void freeClient(client *c) {
listDelNode(server.clients_to_close,ln); listDelNode(server.clients_to_close,ln);
} }
/* If it is our master that's beging disconnected we should make sure /* If it is our master that's being disconnected we should make sure
* to cache the state to try a partial resynchronization later. * to cache the state to try a partial resynchronization later.
* *
* Note that before doing this we make sure that the client is not in * Note that before doing this we make sure that the client is not in
...@@ -1491,7 +1491,7 @@ void resetClient(client *c) { ...@@ -1491,7 +1491,7 @@ void resetClient(client *c) {
} }
} }
/* This funciton is used when we want to re-enter the event loop but there /* This function is used when we want to re-enter the event loop but there
* is the risk that the client we are dealing with will be freed in some * is the risk that the client we are dealing with will be freed in some
* way. This happens for instance in: * way. This happens for instance in:
* *
...@@ -2050,7 +2050,7 @@ char *getClientPeerId(client *c) { ...@@ -2050,7 +2050,7 @@ char *getClientPeerId(client *c) {
return c->peerid; return c->peerid;
} }
/* Concatenate a string representing the state of a client in an human /* Concatenate a string representing the state of a client in a human
* readable format, into the sds string 's'. */ * readable format, into the sds string 's'. */
sds catClientInfoString(sds s, client *client) { sds catClientInfoString(sds s, client *client) {
char flags[16], events[3], conninfo[CONN_INFO_LEN], *p; char flags[16], events[3], conninfo[CONN_INFO_LEN], *p;
...@@ -3050,7 +3050,7 @@ void stopThreadedIO(void) { ...@@ -3050,7 +3050,7 @@ void stopThreadedIO(void) {
* we need to handle in parallel, however the I/O threading is disabled * we need to handle in parallel, however the I/O threading is disabled
* globally for reads as well if we have too little pending clients. * globally for reads as well if we have too little pending clients.
* *
* The function returns 0 if the I/O threading should be used becuase there * The function returns 0 if the I/O threading should be used because there
* are enough active threads, otherwise 1 is returned and the I/O threads * are enough active threads, otherwise 1 is returned and the I/O threads
* could be possibly stopped (if already active) as a side effect. */ * could be possibly stopped (if already active) as a side effect. */
int stopThreadedIOIfNeeded(void) { int stopThreadedIOIfNeeded(void) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment