Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Cyrill Gorcunov <gorcunov@gmail.com>,
	tml <tarantool-patches@dev.tarantool.org>
Subject: Re: [Tarantool-patches] [PATCH 02/17] recovery: convert WalSubscription class to structure
Date: Sun, 3 May 2020 20:42:53 +0200	[thread overview]
Message-ID: <15ec7d64-b76a-4f7e-b1b0-80e59bf74f36@tarantool.org> (raw)
In-Reply-To: <20200428161137.20536-3-gorcunov@gmail.com>

Thanks for the patch!

See 3 comments below.

> diff --git a/src/box/recovery.cc b/src/box/recovery.cc
> index 1d0e80057..76b771a91 100644
> --- a/src/box/recovery.cc
> +++ b/src/box/recovery.cc
> @@ -375,83 +375,92 @@ recovery_finalize(struct recovery *r)
>   * file triggers a wakeup. The WAL dir path is set in the
>   * constructor. XLOG file path is set with set_log_path().

1. Maybe it is worth changing set_log_path() to
wal_subscr_set_log_path().

>   */
> -class WalSubscription {
> -public:
> -	struct fiber *f;
> -	unsigned events;
> -	struct ev_stat dir_stat;
> -	struct ev_stat file_stat;
> -	char dir_path[PATH_MAX];
> -	char file_path[PATH_MAX];
> -
> -	static void dir_stat_cb(struct ev_loop *, struct ev_stat *stat, int)
> -	{
> -		((WalSubscription *)stat->data)->wakeup(WAL_EVENT_ROTATE);
> -	}
> -
> -	static void file_stat_cb(struct ev_loop *, struct ev_stat *stat, int)
> -	{
> -		((WalSubscription *)stat->data)->wakeup(WAL_EVENT_WRITE);
> -	}
> +struct wal_subscr {

2. Lets better not truncate the name. 'subscr' looks ugly.
'wal_subscription' is a fine name, not too long. If you are strictly
against 'subscription', 'wal_sub' would be better too, IMO. At least
it is pronounceable.

> +	struct fiber	*f;
> +	unsigned int	events;
> +	struct ev_stat	dir_stat;
> +	struct ev_stat	file_stat;
> +	char		dir_path[PATH_MAX];
> +	char		file_path[PATH_MAX];

3. Please, don't align struct members. That is not our code style
and creates problems, when a new member is added with a too long
type name.

  reply	other threads:[~2020-05-03 18:42 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-28 16:11 [Tarantool-patches] [PATCH 00/17] recovery: move from cxx to c code Cyrill Gorcunov
2020-04-28 16:11 ` [Tarantool-patches] [PATCH 01/17] recovery: do not call recovery_stop_local inside recovery_delete Cyrill Gorcunov
2020-04-28 16:11 ` [Tarantool-patches] [PATCH 02/17] recovery: convert WalSubscription class to structure Cyrill Gorcunov
2020-05-03 18:42   ` Vladislav Shpilevoy [this message]
2020-04-28 16:11 ` [Tarantool-patches] [PATCH 03/17] recovery: recovery_close_log -- don't throw exception Cyrill Gorcunov
2020-05-03 18:43   ` Vladislav Shpilevoy
2020-04-28 16:11 ` [Tarantool-patches] [PATCH 04/17] recovery: recovery_open_log " Cyrill Gorcunov
2020-05-03 18:43   ` Vladislav Shpilevoy
2020-04-28 16:11 ` [Tarantool-patches] [PATCH 05/17] recovery: recover_xlog " Cyrill Gorcunov
2020-05-03 18:44   ` Vladislav Shpilevoy
2020-04-28 16:11 ` [Tarantool-patches] [PATCH 06/17] recovery: recover_remaining_wals " Cyrill Gorcunov
2020-05-03 18:44   ` Vladislav Shpilevoy
2020-04-28 16:11 ` [Tarantool-patches] [PATCH 07/17] recovery: hot_standby_f " Cyrill Gorcunov
2020-05-03 18:45   ` Vladislav Shpilevoy
2020-04-28 16:11 ` [Tarantool-patches] [PATCH 08/17] recovery: recovery_follow_local " Cyrill Gorcunov
2020-05-03 18:46   ` Vladislav Shpilevoy
2020-04-28 16:11 ` [Tarantool-patches] [PATCH 09/17] recovery: recovery_new " Cyrill Gorcunov
2020-05-03 18:47   ` Vladislav Shpilevoy
2020-04-28 16:11 ` [Tarantool-patches] [PATCH 10/17] recovery: recovery_scan " Cyrill Gorcunov
2020-05-03 18:47   ` Vladislav Shpilevoy
2020-04-28 16:11 ` [Tarantool-patches] [PATCH 11/17] recovery: recovery_finalize " Cyrill Gorcunov
2020-04-28 16:11 ` [Tarantool-patches] [PATCH 12/17] recovery: recovery_stop_local " Cyrill Gorcunov
2020-05-03 18:47   ` Vladislav Shpilevoy
2020-04-28 16:11 ` [Tarantool-patches] [PATCH 13/17] recovery: cxx to c transition Cyrill Gorcunov
2020-04-28 16:11 ` [Tarantool-patches] [PATCH 14/17] recovery: drop redundant type_XlogGapError Cyrill Gorcunov
2020-04-28 16:11 ` [Tarantool-patches] [PATCH 15/17] recovery: provide throwable wrappers Cyrill Gorcunov
2020-04-28 16:11 ` [Tarantool-patches] [PATCH 16/17] box: use _xc helpers of recovery code Cyrill Gorcunov
2020-05-03 18:47   ` Vladislav Shpilevoy
2020-04-28 16:11 ` [Tarantool-patches] [PATCH 17/17] relay: use _xc recovery helpers Cyrill Gorcunov
2020-04-28 16:24 ` [Tarantool-patches] [PATCH 01/17] recovery: do not call recovery_stop_local inside recovery_delete Cyrill Gorcunov

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=15ec7d64-b76a-4f7e-b1b0-80e59bf74f36@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=gorcunov@gmail.com \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 02/17] recovery: convert WalSubscription class to structure' \
    /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