-
Notifications
You must be signed in to change notification settings - Fork 63
Update README and code comments #391
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
Conversation
| // Either there's a bug or we're in a bad state so not much we can do here. We'll try clearing | ||
| // our state and retry getting the changes from the top again in case something broke while | ||
| // fetching the changes. | ||
| // It doesn't make sense to retry processing the changes immediately since this isn't a connection based issue. |
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.
super nit: connection-based
README.md
Outdated
| e.g. `Leases_7d12c06c6ddff24c_1845581613` | ||
| This table is used to ensure that all changes are processed and that no change is processed more than once. This table consists of two groups of columns : |
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.
nit: extra space before column
README.md
Outdated
| In addition a schema named `az_func` will be created that the tables will belong to. | ||
| The login the trigger is configured to use must be given permissions to create these tables and schema. If not then an error will be thrown and the trigger will fail to be ran. |
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.
will fail to run
README.md
Outdated
| The login the trigger is configured to use must be given permissions to create these tables and schema. If not then an error will be thrown and the trigger will fail to be ran. | ||
| If the tables are deleted or modified then unexpected behavior may occur. To reset the state of the triggers first stop all currently running functions with trigger bindings and then either truncate or delete the tables - the next time a function with a trigger binding is started it will recreate the tables as necessary. |
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.
modified,
README.md
Outdated
| The trigger functionality creates a number of tables to use for tracking the current state of the trigger. This allows state to be persisted across sessions and for multiple instances of a trigger binding to execute in parallel (for scaling purposes). | ||
| In addition a schema named `az_func` will be created that the tables will belong to. |
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.
addition,
README.md
Outdated
| ##### azfunc.Leases_* | ||
| A `Leases_*` table is created for every unique instance of a function and table. The full name will be in the format `Leases_<FunctionId>_<TableId>` where `<FunctionId>` is a hash of the Host ID assigned by the function runtime and `<TableId>` is the SQL Object ID of the table being tracked. |
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.
Do leases tables ever get cleaned up?
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.
Yes - after every function invocation we clean up old rows from previous sync versions.
| DELETE FROM {this._leasesTableName} WITH (TABLOCKX) WHERE {SqlTriggerConstants.LeasesTableChangeVersionColumnName} <= {newLastSyncVersion}; |
README.md
Outdated
| The login the trigger is configured to use must be given permissions to create these tables and schema. If not then an error will be thrown and the trigger will fail to run. | ||
| If the tables are deleted or modified, then unexpected behavior may occur. To reset the state of the triggers first stop all currently running functions with trigger bindings and then either truncate or delete the tables - the next time a function with a trigger binding is started it will recreate the tables as necessary. |
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.
Put commas in:
If not, then an error will be thrownor use 'Otherwise'.To reset the state of the triggers, first stop all currently running functionsthe next time a function with a trigger binding is started, it will recreate the tables as necessary.
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.
Done (sorta - I basically copied everything into word and just took the suggestions there to add commas where it suggested)
README.md
Outdated
| ##### azfunc.Leases_* | ||
| A `Leases_*` table is created for every unique instance of a function and table. The full name will be in the format `Leases_<FunctionId>_<TableId>` where `<FunctionId>` is a hash of the Host ID assigned by the function runtime and `<TableId>` is the SQL Object ID of the table being tracked. | ||
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.
I am not sure if the implementation details will benefit the users reading the Readme file. We can instead mention that the leases table's names are based on the user function and the table's object ID.
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.
Done
README.md
Outdated
| A `Leases_*` table is created for every unique instance of a function and table. The full name will be in the format `Leases_<FunctionId>_<TableId>` where `<FunctionId>` is a hash of the Host ID assigned by the function runtime and `<TableId>` is the SQL Object ID of the table being tracked. | ||
| e.g. `Leases_7d12c06c6ddff24c_1845581613` |
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.
Can we not have a separate paragraph for the example and just merge it with the paragraph above?
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.
Done
* Update README and code comments * more * PR comments * Add cleanup docs * Fix spelling * pr comments
Closes #283
Closes #303