Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: tarantool-patches@freelists.org,
	Georgy Kirichenko <georgy@tarantool.org>,
	tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [tarantool-patches] Re: [PATCH v2 4/4] replication: use wal memory buffer to fetch rows
Date: Tue, 22 Oct 2019 01:05:27 +0200	[thread overview]
Message-ID: <abf50761-e46a-e358-f099-f071da378933@tarantool.org> (raw)
In-Reply-To: <0db07768-c555-a3f6-12d0-a33a267deaf7@tarantool.org>

See 5 comments below.

>> diff --git a/src/box/relay.cc b/src/box/relay.cc
>> index 21674119d..1e65d6d56 100644
>> --- a/src/box/relay.cc
>> +++ b/src/box/relay.cc
>> @@ -161,9 +163,9 @@ relay_new(struct replica *replica)
>>  	}
>>  	relay->replica = replica;
>>  	relay->last_row_time = ev_monotonic_now(loop());
>> -	fiber_cond_create(&relay->reader_cond);
>>  	diag_create(&relay->diag);
>>  	relay->state = RELAY_OFF;
>> +	relay->r = NULL;
> 
> 1. Why? 'relay' is allocated using 'calloc' a few lines
> above, 'r' is NULL already.
> 

1. Why did you ignore that comment?

>> +	relay->wal_dir = strdup(cfg_gets("wal_dir"));
>> +	if (relay->wal_dir == NULL) {
>> +		diag_set(OutOfMemory, strlen(cfg_gets("wal_dir")),
> 
> 10. I know, I am a fucking bore, but 'strlen() + 1', for terminating
> zero :)
> 

2. Why did you ignore that comment?

>> +			 "runtime", "wal_dir");
> 
> 11. There is a strict rule what arguments we pass to diag_raise -
> it is size, allocator function, variable name. Allocator function
> here is 'strdup', not 'runtime'.
> 

3. Why did you ignore that comment?

>> +	struct fiber_cond xrow_buf_cond;
>>  };
>>  
>>  struct wal_msg {
>> @@ -1131,6 +1134,7 @@ wal_writer_f(va_list ap)
>>  	(void) ap;
>>  	struct wal_writer *writer = &wal_writer_singleton;
>>  	xrow_buf_create(&writer->xrow_buf);
>> +	fiber_cond_create(&writer->xrow_buf_cond);
> 
> 18. Where do you call fiber_cond_destroy()?
> 

4. Why did you ignore that comment?

>> +
>>  #if defined(__cplusplus)
>>  } /* extern "C" */
>>  #endif /* defined(__cplusplus) */
>> diff --git a/src/lib/core/cbus.c b/src/lib/core/cbus.c
>> index b3b1280e7..b7e6d769b 100644
>> --- a/src/lib/core/cbus.c
>> +++ b/src/lib/core/cbus.c
>> @@ -284,6 +284,9 @@ cpipe_flush_cb(ev_loop *loop, struct ev_async *watcher, int events)
>>  	/* Trigger task processing when the queue becomes non-empty. */
>>  	bool output_was_empty;
>>  
>> +	int old_cancel_state;
>> +	pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &old_cancel_state);
> 
> 28. Why?
> 

5. Why did you ignore that comment?

>> +
>>  	tt_pthread_mutex_lock(&endpoint->mutex);
>>  	output_was_empty = stailq_empty(&endpoint->output);
>>  	/** Flush input */
>> @@ -297,6 +300,7 @@ cpipe_flush_cb(ev_loop *loop, struct ev_async *watcher, int events)
>>  
>>  		ev_async_send(endpoint->consumer, &endpoint->async);
>>  	}
>> +	pthread_setcancelstate(old_cancel_state, NULL);
>>  }
> 
> 29. I will review the tests later, when I will fully understand the
> code. But so few tests for such a serious feature looks not enough.
> Could you test it more rigorous?
> 

6. So have you succeed in that hacking? I am mostly
interested in tests about slow replication with fast
WAL writing.

  parent reply	other threads:[~2019-10-21 23:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1568798455.git.georgy@tarantool.org>
     [not found] ` <21c3aa57-72c7-a8b1-e9e8-5fbb92f22ed9@tarantool.org>
     [not found]   ` <20190920075249.GI8859@atlas>
     [not found]     ` <5842734.CUO0naIOha@home.lan>
2019-10-21 23:03       ` [Tarantool-patches] [tarantool-patches] Re: [PATCH v2 0/4] In-memory wal replication Vladislav Shpilevoy
     [not found] ` <4885469.V32OVRv9ck@home.lan>
     [not found]   ` <c21b86af-ef18-7040-4380-78b01c48203f@tarantool.org>
     [not found]     ` <2210179.PDX6z0RLMb@home.lan>
     [not found]       ` <68c06ac1-3a3f-bae2-ebf4-79c1ae63cb64@tarantool.org>
2019-10-21 23:04         ` [Tarantool-patches] [tarantool-patches] Re: [PATCH v2 2/4] wal: wal memory buffer Vladislav Shpilevoy
     [not found] ` <68fa00546c99b7b53c1c3024881a19024513104d.1568798455.git.georgy@tarantool.org>
     [not found]   ` <772fcc2b-bf03-19d1-6431-1b7d2b058865@tarantool.org>
2019-10-21 23:04     ` Vladislav Shpilevoy
     [not found] ` <5dc83b86bbeada22342c355648de2daa7766bb73.1568798455.git.georgy@tarantool.org>
     [not found]   ` <a6cec753-ce56-f91f-1305-383380a2d630@tarantool.org>
     [not found]     ` <1816701.j1k7ruT3f3@home.lan>
     [not found]       ` <569ff681-a670-f4ca-3c6f-75c159e21429@tarantool.org>
2019-10-21 23:04         ` [Tarantool-patches] [tarantool-patches] Re: [PATCH v2 3/4] wal: xrow buffer cursor Vladislav Shpilevoy
     [not found] ` <0d9ae1e9b32cb8334bf6007de4cb62ce62f87fcb.1568798455.git.georgy@tarantool.org>
     [not found]   ` <0db07768-c555-a3f6-12d0-a33a267deaf7@tarantool.org>
2019-10-21 23:05     ` Vladislav Shpilevoy [this message]
     [not found]     ` <2613444.GBVTE10AvH@home.lan>
     [not found]       ` <84edf0e4-a878-64be-d2f3-694cc672ec9a@tarantool.org>
2019-10-21 23:05         ` [Tarantool-patches] [tarantool-patches] Re: [PATCH v2 4/4] replication: use wal memory buffer to fetch rows Vladislav Shpilevoy

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=abf50761-e46a-e358-f099-f071da378933@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=georgy@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [Tarantool-patches] [tarantool-patches] Re: [PATCH v2 4/4] replication: use wal memory buffer to fetch rows' \
    /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