Skip to content
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

schemeshard: reject operations with too big local tx commit #6760

Merged

Conversation

ijon
Copy link
Collaborator

@ijon ijon commented Jul 16, 2024

Add commit redo size check for successfully ignited operations as a precaution measure to avoid infinite loop of schemeshard hitting local tx commit redo size limit, restarting, attempting to propose persisted operation again, hitting commit redo size limit again, restarting and so on.

This could happen with inherently massive operations such as copy-tables used as a starting step of database export/backup.

Coping large number of tables with huge number of partitions can result in so large TTxOperationPropose local transaction that its size would hit the limit imposed by the tablet executor. Tablet violating that limit is considered broken and will be immediately stopped.
See ydb/core/tablet_flat/flat_executor.cpp, NTabletFlatExecutor::TExecutor::ExecuteTransaction().

#6677
KIKIMR-21751

Changelog entry

Fix handling of backups of too massive databases (in terms of number of tables and number of table partitions).

Changelog category

  • Bugfix

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

@ijon ijon removed the new-feature label Jul 16, 2024
@ijon ijon linked an issue Jul 16, 2024 that may be closed by this pull request
Add commit redo size check for successfully ignited operations
as a precaution measure to avoid infinite loop of schemeshard
hitting local tx commit redo size limit, restarting, attempting
to propose persisted operation again, hitting commit redo size
limit again, restarting and so on.

This could happen with inherently massive operations such as
copy-tables used as a starting step of database export/backup.

Coping large number of tables with huge number of partitions can
result in so large TTxOperationPropose local transaction size that
it would hit the limit imposed by the tablet executor level.
Tablet violating that limit is considered broken and will be
immediately stopped.
See ydb/core/tablet_flat/flat_executor.cpp,
NTabletFlatExecutor::TExecutor::ExecuteTransaction().

KIKIMR-21751
@ijon ijon force-pushed the fix-schemeshard-reject-too-massive-operations branch from 49663a2 to 2aebaf7 Compare July 18, 2024 11:30
@ijon ijon requested review from snaury and CyberROFL July 18, 2024 11:31
Copy link

github-actions bot commented Jul 18, 2024

2024-07-18 11:32:11 UTC Pre-commit check for ba35cb6 has started.
2024-07-18 11:34:58 UTC Build+Tests linux-x86_64-release-asan is running...
🟢 2024-07-18 13:42:53 UTC Build successful.
🔴 2024-07-18 13:44:49 UTC Some tests failed, follow the links below.

Test history | Ya make output

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
9646 9068 0 83 322 173

🟢 2024-07-18 13:45:42 UTC ydbd size 5.2 GiB changed* by +62.4 KiB, which is < 100.0 KiB vs main: OK

ydbd size dash main: fd163cc merge: ba35cb6 diff diff %
ydbd size 5 546 935 280 Bytes 5 546 999 128 Bytes +62.4 KiB +0.001%
ydbd stripped size 1 195 318 000 Bytes 1 195 331 248 Bytes +12.9 KiB +0.001%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

Copy link

github-actions bot commented Jul 18, 2024

2024-07-18 11:32:17 UTC Pre-commit check for ba35cb6 has started.
2024-07-18 11:35:02 UTC Build+Tests linux-x86_64-release-clang14 is running...
🟢 2024-07-18 11:54:08 UTC Build successful.

Copy link

github-actions bot commented Jul 18, 2024

2024-07-18 11:34:36 UTC Pre-commit check for ba35cb6 has started.
2024-07-18 11:37:27 UTC Build+Tests linux-x86_64-relwithdebinfo is running...
🟢 2024-07-18 13:10:28 UTC Build successful.
🔴 2024-07-18 13:12:30 UTC Some tests failed, follow the links below.

Test history | Ya make output

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
13915 12588 0 6 1307 14

🟢 2024-07-18 13:13:12 UTC ydbd size 8.0 GiB changed* by +80.8 KiB, which is < 100.0 KiB vs main: OK

ydbd size dash main: 302e204 merge: ba35cb6 diff diff %
ydbd size 8 642 536 216 Bytes 8 642 618 984 Bytes +80.8 KiB +0.001%
ydbd stripped size 470 525 536 Bytes 470 534 304 Bytes +8.6 KiB +0.002%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

}

// Apply accumulated changes (changes could be empty)
OnComplete.ApplyOnExecute(Self, txc, ctx);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Смущает, что в ApplyOnExecute передаётся txc. Я вроде бы перепроверил, и там в базу пишется только в некоторых случаях, и по идее в dependencies мы много не должны сохранить, в будущем надеюсь мы сделаем чтобы у нас всё это оптимистично в базу добавлялось и разночтений не возникало...

@ijon ijon merged commit ebee36a into ydb-platform:main Jul 18, 2024
8 of 12 checks passed
ijon added a commit to ijon/ydb that referenced this pull request Jul 18, 2024
…form#6760)

Add commit redo size check for successfully ignited operations as a precaution measure to avoid infinite loop of schemeshard hitting local tx commit redo size limit, restarting, attempting to propose persisted operation again, hitting commit redo size limit again, restarting and so on.

This could happen with inherently massive operations such as copy-tables used as a starting step of database export/backup.

Coping large number of tables with huge number of partitions can result in so large TTxOperationPropose local transaction that its size would hit the limit imposed by the tablet executor. Tablet violating that limit is considered broken and will be immediately stopped.
See ydb/core/tablet_flat/flat_executor.cpp, NTabletFlatExecutor::TExecutor::ExecuteTransaction().

KIKIMR-21751
ijon added a commit to ijon/ydb that referenced this pull request Jul 18, 2024
…form#6760)

Add commit redo size check for successfully ignited operations as a precaution measure to avoid infinite loop of schemeshard hitting local tx commit redo size limit, restarting, attempting to propose persisted operation again, hitting commit redo size limit again, restarting and so on.

This could happen with inherently massive operations such as copy-tables used as a starting step of database export/backup.

Coping large number of tables with huge number of partitions can result in so large TTxOperationPropose local transaction that its size would hit the limit imposed by the tablet executor. Tablet violating that limit is considered broken and will be immediately stopped.
See ydb/core/tablet_flat/flat_executor.cpp, NTabletFlatExecutor::TExecutor::ExecuteTransaction().

KIKIMR-21751
ijon added a commit to ijon/ydb that referenced this pull request Jul 20, 2024
…form#6760)

Add commit redo size check for successfully ignited operations as a precaution measure to avoid infinite loop of schemeshard hitting local tx commit redo size limit, restarting, attempting to propose persisted operation again, hitting commit redo size limit again, restarting and so on.

This could happen with inherently massive operations such as copy-tables used as a starting step of database export/backup.

Coping large number of tables with huge number of partitions can result in so large TTxOperationPropose local transaction that its size would hit the limit imposed by the tablet executor. Tablet violating that limit is considered broken and will be immediately stopped.
See ydb/core/tablet_flat/flat_executor.cpp, NTabletFlatExecutor::TExecutor::ExecuteTransaction().

KIKIMR-21751
ijon added a commit that referenced this pull request Jul 22, 2024
) (#6850)

merged ebee36a from main

Add commit redo size check for successfully ignited operations as a precaution measure to avoid infinite loop of schemeshard hitting local tx commit redo size limit, restarting, attempting to propose persisted operation again, hitting commit redo size limit again, restarting and so on.

This could happen with inherently massive operations such as copy-tables used as a starting step of database export/backup.

Coping large number of tables with huge number of partitions can result in so large TTxOperationPropose local transaction that its size would hit the limit imposed by the tablet executor. Tablet violating that limit is considered broken and will be immediately stopped. See ydb/core/tablet_flat/flat_executor.cpp, NTabletFlatExecutor::TExecutor::ExecuteTransaction().

KIKIMR-21751
ijon added a commit that referenced this pull request Jul 22, 2024
) (#6849)

merged ebee36a from main

Add commit redo size check for successfully ignited operations as a precaution measure to avoid infinite loop of schemeshard hitting local tx commit redo size limit, restarting, attempting to propose persisted operation again, hitting commit redo size limit again, restarting and so on.

This could happen with inherently massive operations such as copy-tables used as a starting step of database export/backup.

Coping large number of tables with huge number of partitions can result in so large TTxOperationPropose local transaction that its size would hit the limit imposed by the tablet executor. Tablet violating that limit is considered broken and will be immediately stopped. See ydb/core/tablet_flat/flat_executor.cpp, NTabletFlatExecutor::TExecutor::ExecuteTransaction().

KIKIMR-21751
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

schemeshard: reject too massive operations
3 participants