Skip to content

Consider an index_errors field in the result of write queries #4118

Open

Description

@danielmewes

This came up in the discussion over in #1032 (comment) .

Currently we silently swallow errors that occur while evaluating secondary index functions. We should consider adding a index_errors field to the return object of write operations. It could have the following format:

index_errors: [{index: "index_name_a", error: "error message"}, {index: "index_name_b", error: "error message"}, ...]

I think it should only contain errors that occurred while evaluating the index functions for the new value of the changed document, not the ones for the old value (for example doing a delete would never have anything in this field).

Activity

  1. added this to the subsequent milestone on Apr 24, 2015
  2. mlucy commented on Apr 24, 2015

    @mlucy
    Member

    It would be nice to have a way to access these errors for documents that existed before you created the index, too.

  3. danielmewes commented on Apr 24, 2015

    @danielmewes
    MemberAuthor

    It would be nice to have a way to access these errors for documents that existed before you created the index, too.

    That would be more complicated though because index post construction is a background process (and there could be a lot of them). So we would need to store them somewhere and allow users to retrieve them later. I think we shouldn't do that unless someone feels really strongly about it.

  4. larkost commented on Apr 24, 2015

    @larkost
    Collaborator

    This is a little out-of-left-field, but what if we added an optarg to index_create that made its response a changefeed? Then the list of errors could be the errors generated during processing and the changed would terminate when the index creation completed (or was stopped).

    This would probably be easy to wrap in the WebUI. If we really wanted to go nuts it could also send back occasional percent-complete messages to make this even more friendly for reporting.

  5. danielmewes commented on Apr 24, 2015

    @danielmewes
    MemberAuthor

    @larkost That sounds pretty neat. I think it's probably too much work for this though.

  6. marshall007 commented on Dec 21, 2016

    @marshall007
    Contributor

    To supplement the initial proposal of including them in the response for write operations, I think @larkost's suggestion might be better realized as a new artificial table like rethinkdb.index_errors

    We could even throw them in the existing rethinkdb.issues table, but given that it's persistent I think that's a little scary. "Issues" generated by secondary index construction would never be "resolved", so that table would bloat over time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions