Coder Social home page Coder Social logo

Decreasing write capacity was disallowed without any reasons, decreasing using Management Console worked about dynamodb-lambda-autoscale HOT 4 OPEN

channl avatar channl commented on July 20, 2024
Decreasing write capacity was disallowed without any reasons, decreasing using Management Console worked

from dynamodb-lambda-autoscale.

Comments (4)

tmitchel2 avatar tmitchel2 commented on July 20, 2024

Hey, yes you're completely right, it is a bug.

I actually noticed that recently and have fixed it on an experimental branch where i am performing a large refactor. https://github.com/channl/dynamodb-lambda-autoscale/blob/experimental/src/ProvisionedThroughtputCalculator.js You can see my change here. Unfortunately just at the moment I have zero spare time to look into this but happy to accept a simple pull request. Otherwise i will soon be merging my refactor to main once fully tested.

from dynamodb-lambda-autoscale.

chris4826 avatar chris4826 commented on July 20, 2024

Hi,
thank's for your feedback.
I compared the files and tried to find a solution.
Unfortunately I have to use your commit dccd224 because the newer commits do not work for me. You have reduced the number of packages in packages.json. When running "npm run build" I'm getting a lot of error, e.g. "gulp dist" not found. Do you already know these problems, too?

So I tried to fix the issue with the old commit where src/utils/ThroughputUtils.js doesn't exists. But src/utils/Throughput.js consists of similar code.

I introduced a new variable for writes:
let isWriteDecrementAllowed = adjustmentContext.AdjustmentType === 'decrement' ? RateLimitedDecrement.isDecrementAllowed(data, adjustmentContext, d => this.calculateDecrementedWriteCapacityValue(d)) : true;

And then changed isAdjustmentAllowed with an addtional or operator:
let isAdjustmentAllowed = isAfterLastDecreaseGracePeriod && isAfterLastIncreaseGracePeriod && (isReadDecrementAllowed || isWriteDecrementAllowed);

I will let you know if this small fix works properly after doing some load test. If you already know that this won't work please let me know.

from dynamodb-lambda-autoscale.

tmitchel2 avatar tmitchel2 commented on July 20, 2024

Yea that doesn't look quite right to me because you would allow a decrement on read if either read or write decrement is allowed, and then the same for writes.

from dynamodb-lambda-autoscale.

chris4826 avatar chris4826 commented on July 20, 2024

I agree with you. I will probably wait till you merge the experimental branch into master because your refactoring is too big in order to select only specific piece of code from the experimental branch.

from dynamodb-lambda-autoscale.

Related Issues (20)

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.