[MXS-196] DCB state is changed prior to polling operation Created: 2015-06-15  Updated: 2015-08-20  Resolved: 2015-08-19

Status: Closed
Project: MariaDB MaxScale
Component/s: Core
Affects Version/s: 1.1.1
Fix Version/s: 1.3.0

Type: Bug Priority: Major
Reporter: martin brampton (Inactive) Assignee: martin brampton (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Environment:

All



 Description   

In poll.c functions poll_add_dcb and poll_remove_dcb, an attempt is made to change the state of the DCB prior to carrying out the operation on the poll list. The state change may fail, in which case the operation is not done. However, if the state change succeeds it is still possible for the operation on the poll list to fail; in this case the state of the DCB is not reverted to what it was originally. Reversion may not be possible in all cases, based on the logic for state transitions. Leaving the DCB in an incorrect state after a failure of a polling list operation has unknown but probably detrimental effects. Correcting this problem may also have unknown detrimental effects.



 Comments   
Comment by Dipti Joshi (Inactive) [ 2015-06-15 ]

martin brampton, Massimiliano Pinto Can you discuss following and provide comments ?

(1) What Error/Warning messages do we log, if operation on poll list fails

(2) what alternatives do we have for remedial actions of the scenario described by Martin
(a) do not change the DCB state before carrying out operation on poll list. If operation on poll list is successful, then only change DCB state
OR (b) temporarily change the DCB state i.e. make temporary copy of DCB, and change the state of the DCB prior to carrying out the operation on the poll list. If operation fails, revert DCB to the temporary copy of DCB
OR any other alternatives

Comment by martin brampton (Inactive) [ 2015-06-15 ]

The first is for add, the second for remove:

LOGIF(LE, (skygw_log_write_flush(
LOGFILE_ERROR,
"Error : Adding dcb %p in state %s "
"to poll set failed. epoll_ctl failed due "
"%d, %s.",
dcb,
STRDCBSTATE(dcb->state),
eno,
strerror(eno))));

LOGIF(LE, (skygw_log_write_flush(
LOGFILE_ERROR,
"Error : epoll_ctl failed due %d, %s.",
eno,
strerror(eno))));

Greater consistency would be an improvement.

Comment by martin brampton (Inactive) [ 2015-06-16 ]

This needs careful review prior to any attempt to create a solution.

Comment by martin brampton (Inactive) [ 2015-07-07 ]

Passed to Markus for review

Comment by markus makela [ 2015-07-07 ]

Review done.

Comment by Dipti Joshi (Inactive) [ 2015-08-18 ]

markus makela, martin brampton : Is this issue closed now ?

Comment by martin brampton (Inactive) [ 2015-08-19 ]

Modifications made and checked.

Generated at Thu Feb 08 03:57:30 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.