Budgeting Inaccuracy?

Hello!
to summarize the issue, budget cost for UpdateAsync is not showing the actual cost left since its throttling!

local budget = DS:GetRequestBudgetForRequestType(Enum.DataStoreRequestType.UpdateAsync)

Running this right before my UpdateAsync call, is this a bug or is it perhaps an issue from my end?

What i personally assume is happening is since multiple servers are updating at roughly a similar time span, the budget is not updating fast enough but then how would i solve that?

The budget for DataStore access is per server, so your issue will not be related to multiple servers interacting with DataStoreService.

Could you share more of your code? Like the context that actually calls the DataStore method?

local function LINK(THROUGH_BOUND)
	if THROUGH_BOUND == false and BOUND == true then return end
	local MAX_RETRIES = 5
	local TRY_DELAY = 2

	for TRY = 1, MAX_RETRIES do
		-- Check DataStore request budget before attempting
		local budget = DS:GetRequestBudgetForRequestType(Enum.DataStoreRequestType.UpdateAsync)

		-- If budget is low, wait or skip this iteration
		print(budget)
		if budget < 1 then
			print(budget)
			warn("Low DataStore budget. Waiting before retry.")
			wait(TRY_DELAY * (2 ^ (TRY - 1)))
			continue
		end

		local SUCCESS, MESSAGE = pcall(function()
			PET_EXIST:UpdateAsync(Lib.Variables.EXIST.KEY_NAME, function(OLD_TABLE)
				local NEW_TABLE = OLD_TABLE or Lib.Functions.Utils.DEEPCOPY(Lib.EXIST.HOLDER)
				local HOLDER_COPY = Lib.Functions.Utils.DEEPCOPY(Lib.EXIST.HOLDER)
				for CLASS_NAME, CLASS_EXIST in pairs(HOLDER_COPY) do
					if not NEW_TABLE[CLASS_NAME] then
						NEW_TABLE[CLASS_NAME] = {}
					end
					for OBJ_NAME, OBJ_TABLE in pairs(CLASS_EXIST) do
						for TIER, AMOUNT in pairs(OBJ_TABLE) do
							local AMOUNT_TO_SAVE = HOLDER_COPY[CLASS_NAME][OBJ_NAME][TIER]
							if not NEW_TABLE[CLASS_NAME][OBJ_NAME] then
								NEW_TABLE[CLASS_NAME][OBJ_NAME] = Lib.EXIST.GET_TYPES(CLASS_NAME)
							end
							if not NEW_TABLE[CLASS_NAME][OBJ_NAME][TIER] then
								NEW_TABLE[CLASS_NAME][OBJ_NAME][TIER] = 0
							end

							NEW_TABLE[CLASS_NAME][OBJ_NAME][TIER] += AMOUNT_TO_SAVE
							if NEW_TABLE[CLASS_NAME][OBJ_NAME][TIER] < 0 then
								NEW_TABLE[CLASS_NAME][OBJ_NAME][TIER] = 0
							end
						end
					end
				end
				Lib.EXIST.GLOBAL_EXIST = NEW_TABLE
				if not THROUGH_BOUND and BOUND == false then 
					Lib.Network.FireAll("EXIST_CLIENT", NEW_TABLE)
				end
				return NEW_TABLE
			end)
		end)

		if SUCCESS then 
			Lib.EXIST.HOLDER = Lib.Functions.Utils.DEEPCOPY(Lib.EXIST.TEMPLATE)
			return
		end
		wait(TRY_DELAY * (2 ^ (TRY - 1)))
	end 
end

if not game:GetService("RunService"):IsStudio() then
	game:BindToClose(function()
		BOUND = true 
		local SUCCESS, ERROR = pcall(function()
			LINK(true)
		end)
		if not SUCCESS then warn(ERROR) end
	end)
end

while true do
	if not BOUND then
		local SUCCESS, ERROR = pcall(function()
			LINK(false)
		end)
		if not SUCCESS then 
			warn(ERROR) 
		end
	end
	wait(Lib.Variables.EXIST.REFRESH_COOLDOWN)
end

there u go!