-
Notifications
You must be signed in to change notification settings - Fork 478
Description
Describe the bug
The batch writer uses this code to actually write data via RPC. The code handles single mutation writes differently than multiple mutations. For single mutations it does a single RPC. For multiple mutations it does 3 or more RPCs like the following.
- contact the tserver to create a session
- make one more calls to the tserver to write mutations using the session id
- contact the tserver get that status of the writes to the session and close the session
In either case if there is a network timeout, the batch writer will retry making the RPCs. However its not know what the status of the previous RPCs is, they could still be processing on the tserver and go through after the batch writer is closed or flushed.
Expected behavior
Writes do not go through after a batch writer is closed or flushed. To accomplish this the single RPC write would probably have to be abandoned. The multistep RPC could be modified to do something like the following in order to prevent write from happening after the batch writer is closed.
- contact the tserver to create a session
- make one more calls to the tserver to write mutations using the session id
- contact the tserver get that status of the writes to the session and close the session. In the case of network failure, retry closing the session until the tserver no longer holds it lock in zookeeper.