none
ADLS Gen2 Concurrent Writes RRS feed

  • Question

  • Suppose I've two processes and they are writing data to the same file, say out.txt. The data written is of same length, say 4.

    Both the threads are running in parallel and append the data to the same file (empty file) with the same content length - 4 though different content data (abcd, 1234). The call on both the threads would look like below:

     

    PATCH /<fs>/out.txt?action=append&amp; position=0 HTTP/1.1
    Host: <name>.dfs.core.windows.net
    Content-Length: 4
    Content-Type: text/plain

    <One of the content data>

    Subsequent request would be to flush and the call on both the threads would still be the same

    PATCH /<fs>/out.txt?action=flush&amp; position=4 HTTP/1.1
    Host: mdleuclidstorage.dfs.core.windows.net
    Content-Length: 0
    Content-Type: text/plain
    If-Match: <etag>

    Now exactly only one of the calls would succeed and it is possible that the thread-1 flushes the data from thread-2 and vice versa. Is there a way to ensure that this cross flush doesn't happen?

    Please guide.



    • Edited by hash1818 Friday, November 15, 2019 1:18 AM
    Friday, November 15, 2019 1:17 AM

All replies