-
Notifications
You must be signed in to change notification settings - Fork 35
Improve logging of rebalancer and recovery #586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
b57d254
eefe222
c05dff5
9d69cc6
62c138e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -318,12 +318,13 @@ _bucket:update({150}, {{'=', 2, vshard.consts.BUCKET.RECEIVING}}) | |
| --- | ||
| - [150, 'receiving'] | ||
| ... | ||
| wait_rebalancer_state("Some buckets are not active", test_run) | ||
| --- | ||
| ... | ||
| -- We should not check the certain status of buckets (e.g. receiving) because | ||
| -- in rare cases we accidentally can get the wrong one. For example we wait for | ||
| -- "receiving" status, but get "garbage" due to some previous rebalancer error. | ||
| wait_rebalancer_state('Error during downloading rebalancer states:.*' .. \ | ||
| 'REBALANCER_INVALID_STATE', test_run) \ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The commit message still mentions |
||
| _bucket:update({150}, {{'=', 2, vshard.consts.BUCKET.ACTIVE}}) | ||
| --- | ||
| - [150, 'active'] | ||
| ... | ||
| vshard.storage.sync() | ||
| --- | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2857,12 +2857,10 @@ local function rebalancer_service_f(service, limiter) | |
| return | ||
| end | ||
| if not status or replicasets == nil then | ||
| local err = status and total_bucket_active_count or replicasets | ||
| if err then | ||
| limiter:log_error(err, service:set_status_error( | ||
| 'Error during downloading rebalancer states: %s', err)) | ||
| end | ||
| log.info('Some buckets are not active, retry rebalancing later') | ||
| local err = total_bucket_active_count | ||
| limiter:log_error(err, service:set_status_error( | ||
| 'Error during downloading rebalancer states: %s, ' .. | ||
| 'retry rebalancing later', err)) | ||
| service:set_activity('idling') | ||
| lfiber.testcancel() | ||
| lfiber.sleep(consts.REBALANCER_WORK_INTERVAL) | ||
Serpentian marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
@@ -2951,18 +2949,16 @@ local function rebalancer_request_state() | |
| return nil, err | ||
| end | ||
| if not M.is_rebalancer_active or rebalancing_is_in_progress() then | ||
| return | ||
| return nil, lerror.make('Rebalancer is not active or is in progress') | ||
| end | ||
| local _bucket = box.space._bucket | ||
| local status_index = _bucket.index.status | ||
| if #status_index:select({BSENDING}, {limit = 1}) > 0 then | ||
| return | ||
| end | ||
| if #status_index:select({BRECEIVING}, {limit = 1}) > 0 then | ||
| return | ||
| end | ||
| if #status_index:select({BGARBAGE}, {limit = 1}) > 0 then | ||
| return | ||
| local repl_id = M.this_replica and M.this_replica.id or '_' | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How can
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you then make these tests have a proper ID? If this is east to do, I would say this is preferable to making the production code have special checks for tests. |
||
| for _, status in pairs({BSENDING, BRECEIVING, BGARBAGE}) do | ||
| if #status_index:select({status}, {limit = 1}) > 0 then | ||
| return nil, lerror.vshard(lerror.code.REBALANCER_INVALID_STATE, | ||
| repl_id, status) | ||
| end | ||
| end | ||
| return { | ||
| bucket_active_count = status_index:count({BACTIVE}), | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.