[ 
https://issues.apache.org/jira/browse/COUCHDB-769?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15087085#comment-15087085
 ] 

ASF GitHub Bot commented on COUCHDB-769:
----------------------------------------

Github user gilv commented on the pull request:

    https://github.com/apache/couchdb-chttpd/pull/82#issuecomment-169601987
  
    @kxepal I need your advice on the following:
    Consider the following use case:
    1. Attachment is stored externally
    2. User download attachment
    3. CouchDB fails to download attachment from Swift ( for example network 
failure )
    
    The relevant code in "chttpd_db" is:
    
    ExtStoreID = couch_att:fetch(att_extstore_id,TmpAtt),
            case ExtStoreID of
                undefined ->
                    couch_log:debug("chttpd_db: Att is not stored in the 
external store ~p~n",[ExtStoreID]),
                    Att = TmpAtt;
                _ ->
                    Att = fabric_att_handler:att_get(Db, TmpAtt),
                    couch_log:debug("chtttpd_db: Got attachment from the 
external store ~p~n",[ExtStoreID])
            end,
    
    My question is: what is the best way to handle this? 
    Should i do something like this:
    
    case   fabric_att_handler:att_get(Db, TmpAtt),
              {ok, Att} ->
                    couch_log:debug("chtttpd_db: Got attachment from the 
external store ~p~n",[ExtStoreID])
             {error,_} ->
                    throw({
                            bad_request,
                            "Please try again later"
                        })
    .....


> Store large attachments external to the .couch file
> ---------------------------------------------------
>
>                 Key: COUCHDB-769
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-769
>             Project: CouchDB
>          Issue Type: New Feature
>          Components: Database Core
>            Reporter: Robert Newson
>            Assignee: Adam Kocoloski
>         Attachments: external_attachments_alpha.patch
>
>
> For attachment-heavy applications storing the attachments in separate files 
> significantly eases compaction problems.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to