Fix user object counter #911

Merged
fyrchik merged 1 commit from dstepanov-yadro/frostfs-node:fix/user_counter into master 2024-09-04 19:51:05 +00:00

Relates #904

The bug was caused by two problems:

  1. The object was saved on node 1, but the metric was not updated. The fact of saving on node 1 is confirmed by logs. Perhaps the problem is updating the metrics. I couldn't reproduce it, but just in case, I added additional logging for Inhume operation.
  2. The object was simultaneously written to node 3 by the put process and the replicator. Because of this, the counter was increased twice. I fixed that.
Relates #904 The bug was caused by two problems: 1. The object was saved on node 1, but the metric was not updated. The fact of saving on node 1 is confirmed by logs. Perhaps the problem is updating the metrics. I couldn't reproduce it, but just in case, I added additional logging for `Inhume` operation. 2. The object was simultaneously written to node 3 by the `put` process and the replicator. Because of this, the counter was increased twice. I fixed that.
dstepanov-yadro changed title from fix/user_counter to Fix user object counter 2024-01-15 15:08:01 +00:00
dstepanov-yadro requested review from storage-core-committers 2024-01-15 15:08:07 +00:00
dstepanov-yadro requested review from storage-core-developers 2024-01-15 15:08:19 +00:00
acid-ant approved these changes 2024-01-16 07:40:57 +00:00
aarifullin approved these changes 2024-01-16 07:41:37 +00:00
fyrchik reviewed 2024-01-16 13:47:06 +00:00
@ -221,6 +221,7 @@ func TestBlobstorFailback(t *testing.T) {
checkShardState(t, te.ng, te.shards[0].id, 0, mode.ReadWrite)
checkShardState(t, te.ng, te.shards[1].id, 0, mode.ReadWrite)
require.NoError(t, te.ng.Close(context.Background()))
Owner

Why not do it in defer, similar to other changes in the recent refactoring?

Why not do it in defer, similar to other changes in the recent refactoring?
Author
Member

There are two te instances created, first instance is closed by regular function call, so I decided to do the same way with the second instance.

There are two `te` instances created, first instance is closed by regular function call, so I decided to do the same way with the second instance.
fyrchik marked this conversation as resolved
@ -87,2 +89,3 @@
err = db.boltDB.Batch(func(tx *bbolt.Tx) error {
return db.put(tx, prm.obj, prm.id, nil, currEpoch)
var e error
res, e = db.put(tx, prm.obj, prm.id, nil, currEpoch)
Owner

What about a unit test for this?

What about a unit test for this?
Author
Member

Done

Done
fyrchik marked this conversation as resolved
dstepanov-yadro force-pushed fix/user_counter from 6399c194a7 to fda9af98fc 2024-01-17 15:52:55 +00:00 Compare
dstepanov-yadro force-pushed fix/user_counter from fda9af98fc to 63d3ed1ad8 2024-01-17 16:04:50 +00:00 Compare
fyrchik approved these changes 2024-01-17 16:16:34 +00:00
fyrchik merged commit 63d3ed1ad8 into master 2024-01-17 16:16:39 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#911
No description provided.