-
Notifications
You must be signed in to change notification settings - Fork 638
Fix vector index billing #11174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix vector index billing #11174
Conversation
f55fae8
to
c047a11
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
TString id = TStringBuilder() | ||
<< buildId << "-" | ||
<< buildInfo.TablePathId.OwnerId << "-" << buildInfo.TablePathId.LocalPathId << "-" | ||
<< billed.GetUploadRows() + billed.GetReadRows() << "-" << billed.GetUploadBytes() + billed.GetReadBytes() << "-" | ||
<< processed.GetUploadRows() + processed.GetReadRows() << "-" << processed.GetUploadBytes() + processed.GetReadBytes(); | ||
|
||
NIceDb::TNiceDb db(txc.DB); | ||
|
||
buildInfo.Billed += toBill; | ||
Self->PersistBuildIndexBilling(db, buildInfo); | ||
billed += toBill; | ||
Self->PersistBuildIndexBilled(db, buildInfo); | ||
|
||
ui64 requestUnits = RequestUnits(toBill); | ||
|
||
TString id = TStringBuilder() | ||
<< buildId << "-" | ||
<< buildInfo.TablePathId.OwnerId << "-" << buildInfo.TablePathId.LocalPathId << "-" | ||
<< buildInfo.Billed.GetRows() << "-" << buildInfo.Billed.GetBytes() << "-" | ||
<< buildInfo.Processed.GetRows() << "-" << buildInfo.Processed.GetBytes(); | ||
|
||
const TString billRecord = TBillRecord() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TString id
was generated with kind of typo: buildInfo.Billed
was always equal to buildInfo.Processed
because we already executed buildInfo.Billed += toBill;
TString id = TStringBuilder() | ||
<< buildId << "-" | ||
<< buildInfo.TablePathId.OwnerId << "-" << buildInfo.TablePathId.LocalPathId << "-" | ||
<< buildInfo.Billed.GetRows() << "-" << buildInfo.Billed.GetBytes() << "-" | ||
<< buildInfo.Processed.GetRows() << "-" << buildInfo.Processed.GetBytes(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is format of this string fixed? Or it can be any unique string?
If any I suggest using <upload rows>-<upload bytes>-<read rows>-<read bytes>
instead of <upload rows + read rows>-<upload bytes + read bytes>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any unique string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I changed it to more detailed format
@@ -786,7 +786,6 @@ struct TSchemeShard::TTxMonitoring : public NTabletFlatExecutor::TTransactionBas | |||
TABLEH() {str << "DebugMessage";} | |||
TABLEH() {str << "SeqNo";} | |||
TABLEH() {str << "Processed";} | |||
TABLEH() {str << "Billed";} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe print the number of rows and bytes read/written here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Billed was removed from per shard status some time ago.
I just noticed that it wasn't removed from this line
⚪ Test history | Ya make output | Test bloat
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
⚪ Test history | Ya make output | Test bloat
⚪ Test history | Ya make output | Test bloat | Test bloat
⚪ Test history | Ya make output | Test bloat | Test bloat | Test bloat
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
⚪ Test history | Ya make output | Test bloat
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
⚪ Test history | Ya make output | Test bloat
⚪ Test history | Ya make output | Test bloat | Test bloat
⚪ Test history | Ya make output | Test bloat | Test bloat | Test bloat
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
⚪ Test history | Ya make output | Test bloat
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
⚪ Test history | Ya make output | Test bloat
⚪ Test history | Ya make output | Test bloat | Test bloat
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
For kmeans tree vector index count of reads almost always not equal to count of uploads.
For common secondary index, they're always equal except fail cases.