Skip to content

Writes made by batch writer may happen after its closed or flushed. #3721

@keith-turner

Description

@keith-turner

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.

  1. contact the tserver to create a session
  2. make one more calls to the tserver to write mutations using the session id
  3. 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.

  1. contact the tserver to create a session
  2. make one more calls to the tserver to write mutations using the session id
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue has been verified to be a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions