You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "László Bodor (Jira)" <ji...@apache.org> on 2022/10/19 12:05:00 UTC
[jira] [Commented] (HIVE-26555) Read-only mode for Hive database
[ https://issues.apache.org/jira/browse/HIVE-26555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17620299#comment-17620299 ]
László Bodor commented on HIVE-26555:
-------------------------------------
design question: can you please describe what kind of failover/fail-back scenarios are you referring to and how exactly a read-only database is a solution in that event? thanks!
> Read-only mode for Hive database
> --------------------------------
>
> Key: HIVE-26555
> URL: https://issues.apache.org/jira/browse/HIVE-26555
> Project: Hive
> Issue Type: New Feature
> Reporter: Teddy Choi
> Assignee: Teddy Choi
> Priority: Minor
> Labels: pull-request-available
> Fix For: 4.0.0-alpha-2
>
> Time Spent: 1h
> Remaining Estimate: 0h
>
> h1. Purpose
> In failover/fail-back scenarios, a Hive database needs to be read-only, while other one is writable to keep a single source of truth.
> h1. User-Facing Changes
> Yes. EnforceReadOnlyDatabaseHook class implements ExecuteWithHookContext interface. hive.exec.pre.hooks needs to have the class name to initiate an instance. The "readonly" database property can be configured to turn it on and off.
> h2. Allowed read operations
> All read operations without any data/metadata change are allowed.
> * EXPLAIN
> * USE(or SWITCHDATABASE)
> * REPLDUMP
> * REPLSTATUS
> * EXPORT
> * KILL_QUERY
> * DESC prefix
> * SHOW prefix
> * QUERY with SELECT or EXPLAIN. INSERT, DELETE, UPDATE are disallowed.
> h2. Allowed write operations
> Most of write operations that change data/metadata are disallowed. There are few allowed exceptions. The first one is alter database to make a database writable. The second one is replication load to load a dumped database.
> * ALTER DATABASE db_name SET DBPROPERTIES without "readonly"="true".
> * REPLLOAD
> h1. Tests
> * read_only_hook.q: USE, SHOW, DESC, DESCRIBE, EXPLAIN, SELECT
> * read_only_delete.q
> * read_only_insert.q
--
This message was sent by Atlassian Jira
(v8.20.10#820010)