snowflake::ingest::streaming::SuccessDetail Class Referencefinal
The payload handed to an elastic-channel success handler (registered via StreamingIngestElasticChannel::SetSuccessHandler()) when appends are acknowledged by Snowflake.
More...
#include <snowflake/ingest/streaming/elastic_channel.h>
Public Member Functions | |
| SuccessDetail (std::vector<AppendToken> append_tokens,std::string request_id,uint16_t retry_count) | |
| const std:: | append_tokens () const noexcept |
| The opaque, caller-supplied append tokens of the appends that were acknowledged. | |
| const std:: | request_id () const noexcept |
| The Snowflake request ID of the acknowledged request. | |
| uint16_t | retry_count () const noexcept |
| How many retries the acknowledged request took: 0 when the first attempt was acknowledged, N when the SDK retried N times before Snowflake accepted it. | |
Detailed Description
The payload handed to an elastic-channel success handler (registered via StreamingIngestElasticChannel::SetSuccessHandler()) when appends are acknowledged by Snowflake.
Delivered once per successful acknowledgement batch and carries the caller-supplied append tokens of every append acknowledged together — a whole server-ack success batch. A success carries no error, only the tokens and the request ID that acknowledged them.
Member Function Documentation
append_tokens¶
|
const std::vector<AppendToken> & SuccessDetail::append_tokens() const
|
inlinenoexcept |
The opaque, caller-supplied append tokens of the appends that were acknowledged.
Never empty; a token reused across appends appears once per acknowledged append (not deduplicated). Read-only — the returned vector must not be modified.
- Returns
- the acknowledged append tokens
request_id¶
|
const std::string & SuccessDetail::request_id() const
|
inlinenoexcept |
The Snowflake request ID of the acknowledged request.
Useful for correlating an acknowledgement with Snowflake-side telemetry.
A support-escalation aid; do not key application logic off it.
- Returns
- the request ID, always present
retry_count¶
|
uint16_t SuccessDetail::retry_count() const
|
inlinenoexcept |
How many retries the acknowledged request took: 0 when the first attempt was acknowledged, N when the SDK retried N times before Snowflake accepted it.
Use this to decide whether these rows may be duplicated in the table. A retry re-sends the same rowset, and the SDK retries whenever it cannot tell that the previous attempt failed: a timeout or a 5xx may mean the rows were never processed, or that they were processed and only the response was lost. So:
0: the SDK sent this rowset once and Snowflake acknowledged that one send. It did not introduce a duplicate.> 0: the SDK sent it more than once before getting this acknowledgement, and an earlier attempt may also have been applied. These rows may appear in the table more than once. Reconcile or de-duplicate downstream if you need exactly-once.
The signal is deliberately conservative: it counts every re-send, including an authentication refresh, which is rejected before the rows are processed and so cannot have duplicated anything. A non-zero count therefore means "a duplicate is possible", not "a duplicate happened"; the SDK does not distinguish the two, and over-reporting is the safe direction for this.
A steadily non-zero count also means the SDK is absorbing retries on your behalf; it is worth reporting alongside the request ID when escalating throughput concerns to Snowflake support.
- Returns
- the number of retries, 0 when there was no retry