Skip to content

Commit

Permalink
Merge pull request #746 from openvstorage/issue_569
Browse files Browse the repository at this point in the history
Issue 569
  • Loading branch information
Romain Slootmaekers authored Jun 29, 2017
2 parents 7534442 + 878eb22 commit 9b548a2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
25 changes: 15 additions & 10 deletions ocaml/src/osd_access.ml
Original file line number Diff line number Diff line change
Expand Up @@ -375,27 +375,28 @@ class osd_access
| Exn Assert_failed _ -> false
| _ -> true
in
let should_invalidate_pool =
let should_invalidate_pool, should_retry =
match exn with
| Exn Assert_failed _ -> false
| Exn Unknown_operation -> false
| Exn Full -> true
| Exn Assert_failed _ -> false, false
| Exn Unknown_operation -> false, false
| Exn Full -> true, false
(* when it's full, we need to disqualify this OSD,
and the 'set' in the requalification loop will eventually requalify it,
fe, when rebalancing creates space on that OSD again
*)
| _ -> true
| End_of_file -> true, true
| _ -> true, true (* quite optimistic: whatever it was, it's gone already *)
in

(if should_invalidate_pool
then
begin
Osd_pool.invalidate osds_pool ~osd_id;
refresh_osd_info ~osd_id
refresh_osd_info ~osd_id >>= fun _ ->
Lwt.return_unit
end
else
Lwt.return false)
>>= fun should_retry ->
else Lwt.return_unit)
>>= fun () ->

if should_retry
then with_osd_from_pool ~osd_id f
Expand All @@ -408,7 +409,11 @@ class osd_access
end
else Lwt.return ())
>>= fun () ->
Lwt_log.debug_f ~exn "Exception in with_osd_from_pool osd_id=%Li" osd_id >>= fun () ->
Lwt_log.debug_f
"Exception %S in with_osd_from_pool osd_id=%Li"
(Printexc.to_string exn)
osd_id
>>= fun () ->
Lwt.fail exn)
and disqualify ~osd_id ~exn =
let rec inner delay =
Expand Down
9 changes: 9 additions & 0 deletions setup/setup.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2875,6 +2875,14 @@ module Test = struct

0

let restart ?(xml=false) ?filter ?dump t =
let fn = "./ocaml/alba.native" in
let ns = "demo" in
let () = t.proxy # upload_object ns fn "xxx" in
let () = Deployment.restart_osds t in
let () = t.proxy # upload_object ns fn "yyy" in
0

let alba_as_osd ?xml ?filter ?dump _t =
let cfg_global, t_global, t_locals, add_backend_as_osd =
setup_global_backend ()
Expand Down Expand Up @@ -3088,6 +3096,7 @@ module Test = struct
transform job_crud "job_crud";
transform aaa "aaa";
transform alba_as_osd "alba_as_osd";
transform restart "restart";
]
in
let results = List.map (fun s -> s t) suites in
Expand Down

0 comments on commit 9b548a2

Please sign in to comment.