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

Boto Glue standard retry policy with configuration #1307

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mark-major
Copy link
Contributor

@mark-major mark-major commented Nov 8, 2024

Configurable retry mechanism for the Glue catalog Boto client.

  • Setting the retry mode to standard
  • Introducing a new configuration glue.max-retries with default value set to 10
  • Adding the new configuration key to the documentation

Closes #1294

configurable max retry
Copy link
Contributor

@Fokko Fokko left a comment

Choose a reason for hiding this comment

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

Thanks @mark-major for raising this PR! I left some suggestions, LMKWYT!

mkdocs/docs/configuration.md Outdated Show resolved Hide resolved
pyiceberg/catalog/glue.py Outdated Show resolved Hide resolved
"max_attempts": get_first_property_value(properties, GLUE_MAX_RETRIES)
if get_first_property_value(properties, GLUE_MAX_RETRIES)
else MAX_RETRIES,
"mode": "standard",
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we also make the mode configurable? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would rather not have that as an option. Standard mode is a more mature implementation compared to the legacy one.Adaptive mode is still considered 'experimental' which is not something I'd use in production.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 to making it configurable just to future-proof.
Still set standard as the default, but can be overridden if necessary

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I'll make the mode configurable

mark-major and others added 2 commits November 9, 2024 00:35
Co-authored-by: Fokko Driesprong <[email protected]>
Co-authored-by: Fokko Driesprong <[email protected]>
Copy link
Contributor

@kevinjqliu kevinjqliu left a comment

Choose a reason for hiding this comment

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

A few nit comments. Curious about the general direction we're taking for configuring the retry mechanism for catalogs. I'm leaning towards a standardized retry config for all catalogs, similar to the commit.retry table configs https://iceberg.apache.org/docs/1.5.2/configuration/#table-behavior-properties

Curious to hear others' thoughts

| glue.access-key-id | admin | Configure the static access key id used to access the Glue Catalog |
| glue.secret-access-key | password | Configure the static secret access key used to access the Glue Catalog |
| glue.session-token | AQoDYXdzEJr... | Configure the static session token used to access the Glue Catalog |
| glue.max-retries | 10 | Configure the maximum number of retries for the Glue service calls |
Copy link
Contributor

Choose a reason for hiding this comment

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

nit, should we add a retry property for each catalog? Or just use the default value in the table retry property?`

commit.retry.num-retries | 4 | Number of times to retry a commit before failing

https://iceberg.apache.org/docs/1.5.2/configuration/#table-behavior-properties

@@ -94,6 +94,7 @@
URI = "uri"
LOCATION = "location"
EXTERNAL_TABLE = "EXTERNAL_TABLE"
MAX_RETRIES = 10
Copy link
Contributor

Choose a reason for hiding this comment

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

nit, use the <>_DEFAULT convention

SkipArchive=property_as_bool(self.properties, GLUE_SKIP_ARCHIVE, GLUE_SKIP_ARCHIVE_DEFAULT),

Also not sure if this property belongs in the __init__ file, unless we're saying that this is the default for all catalogs

"max_attempts": get_first_property_value(properties, GLUE_MAX_RETRIES)
if get_first_property_value(properties, GLUE_MAX_RETRIES)
else MAX_RETRIES,
"mode": "standard",
Copy link
Contributor

Choose a reason for hiding this comment

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

+1 to making it configurable just to future-proof.
Still set standard as the default, but can be overridden if necessary

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

Successfully merging this pull request may close these issues.

Adaptive retry for Glue Catalog calls to fix Glue throttling
3 participants