GithubHelp home page GithubHelp logo

md5 at the proxy about swift HOT 9 CLOSED

icorderi avatar icorderi commented on August 25, 2024
md5 at the proxy

from swift.

Comments (9)

thiagodasilva avatar thiagodasilva commented on August 25, 2024

@icorderi I think this patch might help: https://review.openstack.org/#/c/124903/
It just wasn't clear why you are trying to bypass the etag calculation. what did i miss?

from swift.

icorderi avatar icorderi commented on August 25, 2024

@thiagol11 Well, in the gluster case or any system plugin in behind that needs only 1 replica it doesn't matter. But for systems that still want to let swift do replication doing n md5()'s is a waste of CPU.
If the Proxy calculates the md5 once, and gives the etag down to the locally running object-servers, you save n-1 md5 calculations.

from swift.

thiagodasilva avatar thiagodasilva commented on August 25, 2024

@icorderi, ok, that's what i figured but just wanted to make sure...I think sam's patch is going to help with that, but of course there are issues as dfg pointed out...

on another note, i got your changes (very nice btw!) and i'm working to clean up the code a bit and add another method of initializing the object server. should i just push those changes on top of yours?

from swift.

icorderi avatar icorderi commented on August 25, 2024

@thiagol11 I'm not sure we need the footer approach. In our case the object-servers are running on the same process as we are, that means we can just calculate the md5() and give it directly to each object-server instance.

eventlet.event.Event can be used as a lazy value.
I was thinking on having the object-server code do a:

etag = environ['Lazy-Etag'].wait() # on the bypass code-path

And have the proxy "clean" code do:

if etag: # send etag to object-servers
    for c in conns:
        if hasattr(c, 'etag'): 
            c.etag = etag # our custom conn object does evt.send(value). 

The etag calculation at the proxy can be turned on by any conn having:

hasattr(conn, 'requires_etag') and conn.requires_etag

What do you think?

from swift.

thiagodasilva avatar thiagodasilva commented on August 25, 2024

@icorderi, sounds pretty clever, just a little unclear on the object server side the wait() would happen in line 433 or 451: https://github.com/icorderi/swift/blob/feature/no-http/swift/obj/server.py
Also

from swift.

thiagodasilva avatar thiagodasilva commented on August 25, 2024

@icorderi, when you have a chance, checkout the change I pushed. It changed things a bit in terms of how to call the object-server, now it is not bypassing all the middleware, which I think might be better.

from swift.

icorderi avatar icorderi commented on August 25, 2024

@thiagol11 the wait() would be in L467

from swift.

icorderi avatar icorderi commented on August 25, 2024

@thiagol11 I don't see any push. Which branch was it?

from swift.

thiagodasilva avatar thiagodasilva commented on August 25, 2024

@icorderi, had made a mistake pushing to another branch, fixed it now. Besides the change in wsgi.py to instantiate the app, the other interesting change is this: https://github.com/icorderi/swift/blob/feature/no-http/swift/proxy/controllers/obj.py#L423,L425

from swift.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.