hibari / gdss-client

http://hibari.github.com/hibari-doc/
Other
2 stars 0 forks source link

brick_simple:delete/4 error response is not matching specification #1

Closed norton closed 13 years ago

norton commented 13 years ago

The following "working" code snippet for brick_simple:delete/4 using testset doesn't match my expectation. I would have expected the error response "key_not_exist" rather than one wrapped in a transaction. This appears to be a case where the implementation is not matching the specification. Dialyzer also says the same thing.

        case brick_simple:delete(Tab, Path, [{testset, TS}], Timeout) of
            ok ->
                ok;
            {txn_fail,[{3,key_not_exist}]} ->
                {error, enoent};
            {ts_error, _} ->
                {error, ebusy};
            Err ->
                %% @TODO {error, eio}
                exit(Err)
        end;

The pattern {'txnfail', [{, 'key_not_exist'}]} can never match the type 'brick_not_available' | 'invalid_flag_present' | 'key_not_exist' | 'txn' | {'key_exists',non_neg_integer()} | {'ok',binary() | maybe_improper_list(binary() | maybe_improper_list(any(),binary() | []) | byte(),binary() | []) | non_neg_integer() | {[{'$end_of_table' | '$start_of_table' | binary() | maybe_improper_list(binary() | maybe_improper_list(any(),binary() | []) | byte(),binary() | []),non_neg_integer()} | {'$end_of_table' | '$start_of_table' | binary() | maybe_improper_list(binary() | maybe_improper_list(any(),binary() | []) | byte(),binary() | []),non_neginteger(),[atom() | {,_}]} | {'$end_of_table' | '$start_of_table' | binary() | maybe_improper_list(binary() | maybe_improper_list(any(),binary() | []) | byte(),binary() | []),non_neg_integer(),binary() | maybe_improper_list(binary() | maybe_improperlist(any(),binary() | []) | byte(),binary() | []),integer(),[atom() | {,_}]}],boolean()}} | {'ts_error',non_neg_integer()} | {'ok',non_neg_integer(),binary() | maybe_improper_list(atom() | binary() | maybe_improperlist(any(),binary() | []) | byte() | {,_},binary() | [])} | {'ok',non_neg_integer(),binary() | maybe_improper_list(binary() | maybe_improperlist(any(),binary() | []) | byte(),binary() | []),integer(),[atom() | {,_}]}

kinogmt commented 13 years ago

brick_server:quota_more_ops() adds two extra ops for quota operations when necessary and brick_server:quotas_pre_enforce_quota() add a 'txn' to the DoList for it. I don't know it is "by design" or a bug.

norton commented 13 years ago

The quota support has been deprecated (and subsequently removed from the code base). This issue is no longer an issue.

Marking as closed.