From: Cyrill Gorcunov via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: tml <tarantool-patches@dev.tarantool.org>
Cc: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Subject: [Tarantool-patches] [PATCH 2/2] xlog: do not sort sole entry
Date: Wed, 10 Mar 2021 23:47:10 +0300 [thread overview]
Message-ID: <20210310204710.186461-3-gorcunov@gmail.com> (raw)
In-Reply-To: <20210310204710.186461-1-gorcunov@gmail.com>
In case if there only one snapshot or xlog file
there is no need to call sorting procedure at all.
In-scope-of #5806
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
src/box/xlog.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/box/xlog.c b/src/box/xlog.c
index 974f460be..89df7e485 100644
--- a/src/box/xlog.c
+++ b/src/box/xlog.c
@@ -588,7 +588,7 @@ xdir_scan(struct xdir *dir, bool is_dir_required)
signatures[s_count++] = signature;
}
/** Sort the list of files */
- if (s_count > 0)
+ if (s_count > 1)
qsort(signatures, s_count, sizeof(*signatures), cmp_i64);
/**
* Update the log dir index with the current state:
--
2.29.2
next prev parent reply other threads:[~2021-03-10 20:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-10 20:47 [Tarantool-patches] [PATCH 0/2] A few fixes for gc and xlog Cyrill Gorcunov via Tarantool-patches
2021-03-10 20:47 ` [Tarantool-patches] [PATCH 1/2] gc: use wide integer for schedule counting Cyrill Gorcunov via Tarantool-patches
2021-03-14 16:30 ` Vladislav Shpilevoy via Tarantool-patches
2021-03-14 18:24 ` Cyrill Gorcunov via Tarantool-patches
2021-03-10 20:47 ` Cyrill Gorcunov via Tarantool-patches [this message]
2021-03-12 17:11 ` [Tarantool-patches] [PATCH 0/2] A few fixes for gc and xlog Serge Petrenko via Tarantool-patches
2021-03-12 17:45 ` Cyrill Gorcunov via Tarantool-patches
2021-03-15 23:21 ` Vladislav Shpilevoy via Tarantool-patches
2021-03-16 13:29 ` Kirill Yukhin via Tarantool-patches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210310204710.186461-3-gorcunov@gmail.com \
--to=tarantool-patches@dev.tarantool.org \
--cc=gorcunov@gmail.com \
--cc=v.shpilevoy@tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH 2/2] xlog: do not sort sole entry' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox